1

I am trying to add liquibase as a version control to our mongoDB,

I want to be able to run an MJS script(mongo js script) as a changes, for sql db it is possible using <sql> liquibase tag,

Does someone knows if it is possible from mongo? if so how? there is no documentation of that in the liquibase website, or any answers on the liquibase forum.

Many thanks,

Roie

Roie Beck
  • 1,113
  • 3
  • 15
  • 30
  • Could you share the link to the question posed on the forum? I couldn't find it, that's usually the best place to go for in depth liquibase answers. Also, you can directly log issues in (or features/doc requests) in the git repo for the mongodb ext: https://github.com/liquibase/liquibase-mongodb/issues. Just making sure you have also read this base documentation: https://docs.liquibase.com/workflows/database-setup-tutorials/mongodb.html – ronak Oct 19 '20 at 20:21
  • @ronak sure :) https://forum.liquibase.org/t/executing-js-script-file-from-liquibase-mongodb-changeset/4726 – Roie Beck Oct 20 '20 at 07:47
  • 1
    I responded on the forum, thanks for adding more details. – ronak Oct 20 '20 at 17:30
  • 1
    @ronak I have rephrased the question can you please take a look? I don't think I explained my self properly the first time... – Roie Beck Oct 22 '20 at 09:29
  • Any news on this? I really need this feature too. – Alkis Mavridis Feb 14 '21 at 09:53
  • 1
    @AlkisMavridis no, they did not help me with the issue in the forum, I ended up using another management tool named mongock(but it is only for java... ) – Roie Beck Feb 14 '21 at 10:07

1 Answers1

0

liquibase-mongodb extension is an alternative to the tools that are wrapping MJS(see mongeeze) into a eval method of mongo java driver. Was developed due to the fact that eval was deprecated in Mongo. You can look into runCommand option(supported by liquibase-mongodb) which lets you implement the most of the required operations including multiple updates. Indeed, will doublecheck if mongo is going to support deprecated eval in the future. Actually the extension was implemented to workaround what you are asking and all the Liquibase changes are implemented close to Mongo Java Driver APIs