Mongock is a java MongoDB tool for tracking, managing and applying database schema changes across all your environments based on a coding approach.
Questions tagged [mongock]
63 questions
0
votes
2 answers
MongoDb error: 'cannot use 'j' option when a host does not have journaling enabled'
I was using mongo in dev just fine, when deploying the app into test env I got this error:
com.mongodb.MongoCommandException: Command failed with error 2 (BadValue): 'cannot use 'j' option when a host does not have journaling enabled' on server…

Шатов Данил
- 11
- 3
0
votes
0 answers
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 creating bean with name…

Шатов Данил
- 11
- 3
0
votes
1 answer
Caused by: java.lang.AbstractMethodError Method...MongockTemplate.updateMulti is abstract
I am using mongock, all migration correctly pass, bun when invoke mongoTemplate.updateMulti then throw an
Caused by: java.lang.AbstractMethodError: Method…

Шатов Данил
- 11
- 3
0
votes
1 answer
how should migrate my DBRef fields with mongock?
I have a problem with migrating an entity which has DBRef fields. If I change any field in this entity, my DBRefs are gone. What should I do?
Query query = new Query();
List criteriaList = new ArrayList();
…

mukara
- 9
- 3
0
votes
2 answers
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 do Mongo database migrations. I need it on only…

salerokada
- 334
- 3
- 7
0
votes
1 answer
module does not opens unanmed module using quarkus and mongock
I get the following issue when starting up quarkus with mongock on java 17:
2022-07-22 07:50:57,109 ERROR [io.mon.run.cor.exe.MongockRunnerImpl] (main) Error in mongock process. ABORTED MIGRATION: io.mongock.api.exception.MongockException:…

mangusbrother
- 3,988
- 11
- 51
- 103
0
votes
1 answer
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 = "001", author =…

obolenskaya00
- 29
- 1
- 6
0
votes
1 answer
Fail to start Mongock CLI with Spring Boot, NullPointerException: Cannot invoke buildRunner
I've tried using Mongock for DB migrations and it's a really good tool. It activates when main application is launched. Recently I found out that there is Mongock CLI, and it suits better for my aims. Unfortunately, I fail to make it work. I took my…

stakeika
- 55
- 1
- 8
0
votes
3 answers
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…

obolenskaya00
- 29
- 1
- 6
0
votes
1 answer
When extending the RepresentationModel class of HATEOAS in the model using mongodb the application no longer works - spring boot
I'm studying spring building an API using spring-boot,mongodb,lombok, mongock... this
project.
When putting HATEOAS I had problems, I noticed that it was related the moment I inherit the RepresentationModel class.
Error complete
Looks like the…
0
votes
0 answers
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" : [{
"id" : "3e4",
"states" : {
"id" :…

Techie
- 81
- 1
- 10
0
votes
1 answer
Can we use mongock as a migration tool to rename mongodb collection
We are going to rename a mongodb collection and writing migration script in our spring boot microservice.Is it ok to use mongock for the same?
Trying to understand if the changeunit is executed once on app startup, would it throw exception once it…

AQS
- 1
0
votes
1 answer
Advice on resetting Mongock Changesets
We are using Mongock in our spring-boot/kotlin microservices as our main Mongo DB migration tool and it is working perfectly. We started with a simple json file to create a few collections and have been adding changesets for a while now.
By now we…

Rob
- 43
- 7
0
votes
1 answer
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.
However, I'm unable to figure out how to write a…

Captain Levi
- 804
- 7
- 18
0
votes
0 answers
Mongock data partitioning
I am trying o migrate data in MongoDB with mongock and stumbled upon an issue when I need to run migration across a big amount of data.
Is there a way to partition this data in any way? I didn't find support for that on documentation.
Problem is…

Constantine
- 381
- 1
- 3
- 10