How to use Javascript as changelog file in Liquibase for mongodb

We have the following requirement. We use Mongodb as the database. Need to use Liquibase.
Create a Javascript file and write db scripts for mongodb. These scripts are DDL like db.collection.inserOne(), update etc.
First data from one collection Emplyoee has to be read from mongo
Second Data should be validated with some logic / rules
update the Employee Data to another Collection EMP.

We need to capture all these 3 steps in one JavaScript file itself.
The Javascript file will be included as Changelog.impl.js in Liquibase for execution.

I tried with Liquibase extension project from Github

This Project has few .JS files. But these files are not used by any classes or Test cases in that project.

Have you come across such requirement where Javascript file is used as Changelog?
If Javascript is not supported, is it possible to achieve this by using any other file format?. It is a sequence of execution of mongodbscripts with some logic applied.
Please share your thoughts.

1 Like