75 questions
0
votes
0
answers
53
views
Mongock rollback method is not executed
I have a collection migrationTest in MongoDB with a unique index for the message field.
In my migration I'm inserting documents to this collection and in one place I'm using the existing message to ...
0
votes
1
answer
162
views
Error 'writeConcern is not allowed within a multi-statement transaction' when starting springboot application with mongock changeunits
I have a springboot application where am integrating mongock to add indices to the database. When I start the application, I see the below exception:
Caused by: io.mongock.api.exception....
-1
votes
1
answer
262
views
What are consequences of deactivating the Mongock-Lock?
Mongock documents that the "default, expected and documented behaviour" for database migrations is to acquire a pessimistic lock on the whole database.
It is, however, possible to run a ...
0
votes
1
answer
461
views
Mongock - Removing outdated ChangeUnit after migration is done (runAlways = false)
I have a ChangeUnit for deleting one collection in my database. The migration has already been done and such change will no longer be required. I am wondering if I can delete the class and get rid of ...
0
votes
1
answer
431
views
Mongock changelog files executing in local system but not executing on server after deployment
Able to execute Mongock changelog files successfully in local but changelog files not executing when I am deploying application jar to the server . I am not getting any error as well. I can see ...
0
votes
1
answer
747
views
can't create an index with mongock on a mongodb collection
Each time I try to create an index on a collection with mongock I have this error:
Command createIndexes does not support this transaction's { readConcern: { level: "majority", provenance: &...
0
votes
2
answers
617
views
MongoCK ChangeUnit doesn't auto wire other spring beans as dependency
How do I make the ChangeUnit work with other spring beans in my app? I've tried adding dependencies to the ChangeUnit via construction injection and setter injection, and using post construct to build ...
0
votes
1
answer
201
views
Mongock failing to log scripts w runAlways=true in mongockChangeLog collection
I currently have four ChangeUnits written as follows:
id="system-codes-initializer" (runAlways=true)
id="source-config-initializer" (runAlways=true)
id="action-box-...
0
votes
0
answers
125
views
Mongock support for JSON changelogs
I'd ideally like to specify my changelog in JSON format, similar to Liquibase's JSON option, as follows below. Notably, I'd also like to do a substitution for the Integer value of clusterId at runtime ...
0
votes
1
answer
588
views
Mongock spring-boot delay bean creation until Mongock is done
With liquibase and Spring Boot I can do @DependsOn("liquibase") to wait when I have a @Bean creating method. This lets me create beans that depend on initialization data.
How do I do this in ...
0
votes
1
answer
482
views
Does Mongock support Mongo version 2.x?
I have to execute migrations on the mongo server version: 2.6.10. I use mongock-springboot 5.2.4, spring boot version 2.7.2 and spring-data-mongodb version 3.4.2.
I don't think it's possible[1], but I'...
0
votes
1
answer
159
views
Repository for mongock-core 4.3.8
I try to update my mongock-core dependency to 4.3.8 (from 3.3.2) but it does not find the jar for the dependency.
So i have checked on the maven central repository i am using (https://repo1.maven....
1
vote
1
answer
1k
views
Mongock does not run changeunit in kotlin project
I have Java + maven project - https://github.com/petersuchy/mongock-test-java based on Mongock reactive example (https://github.com/mongock/mongock-examples/tree/master/mongodb/springboot-reactive)
...
0
votes
1
answer
509
views
mongock: @Execution vs @BeforeExecution
Where is I should define scheme validation rules using mongock as migration tool?
In official library examples it's placed in the @BeforeExecution section. Why?
0
votes
0
answers
194
views
MongockTemplate bean in integration test
how to autowired MongockTemplate in SpringBootTest?
MongockTemplate does not autowired in @SpringBootTest
I try:
full exception:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error ...
0
votes
1
answer
736
views
How to implement @RollbackExecution method for Mongock
I have simple document class:
public class Player {
private String name;
private String age;
}
I want to extend it with field Parameters:
public class Player {
private String name;
...
0
votes
2
answers
2k
views
Running Mongock on only one database in multidatabase Spring project
I have quite large legacy multi module Java Spring boot project which connects to one MySql database and two Mongo databases (lets say codebook and report).
I'm trying to setup Mongock to be able to ...
0
votes
1
answer
477
views
mongock @BeforeExecution is not executed
I need to initialize admin from env variables, but @BeforeExecution method is not launched, execution directly starts in initAdmin method. Any suggestions?
@ChangeUnit(id = "init", order = &...
1
vote
3
answers
963
views
field annotated with `@value` is not initialized in mongock configuration
I need to assure data migration using mongock.
The @ChangeUnit class holds the logic for migration. It has a field annotated with @Value which is always null, even though I properly initialized in ...
0
votes
0
answers
252
views
Using sprinboot convert existing document's inner object to an array
I have below structure in MongoDB :
{
"id" : "6c71-fea4-4bg6-a0bf-768n0n54t59",
"continents" : [
{
"id" : "45" ,
"countries&...
2
votes
1
answer
521
views
MongoDB: Search by field with date and update it by condition
Please tell me how can I fulfill the following condition - if the time in the info.startDate field is not equal to 00 hours, increase the date (2021-05-27) by 1 day ahead, set the time to 00:00:00....
1
vote
1
answer
2k
views
How to test change unit in mongock with its multiple attributes/lifecycle methods?
We recently migrated from MongoBee to Mongock, and with Mongock 5 version the @ChangeLog and @ChangeSet are depricated. Writing the @ChangeUnit is easy enough and rollback methods are very helpful.
...
0
votes
1
answer
2k
views
How to handle downgrade operation with Mongock?
I have a question about performing downgrade together with Mongock. I got Java Spring application integrated with mongock and let's suppose that I upgraded my application from v1 to v2. During the ...
0
votes
1
answer
331
views
Launch Mongock faster so when changelog fails the application crashes before a heath check can pass
We recently added MongoCk to our Spring 5 app (using the Spring runner), but are having some issues during our deploys. Our final step in the deploy process is a health check where the deployment ...
0
votes
0
answers
76
views
Is there a way to use Regex to execute indexOps on Mongo?
I've some collections on my database that have a 'Dynamic Name',
Let's say that I've some collections that store Animals data from an specific country,
So in my database Animals I would have the ...