liquibase mongodb run a js script file from liquibase as change set

1.2k Views Asked by At

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

1

There are 1 best solutions below

0
On

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