Run MongoDB version 7.0
locally running on port 27017
using Mongo Docker Image:
docker-compose up
Stop server and delete resources:
docker-compose down -v --rmi local --remove-orphans
Using Flyway to migrate MongoDB scripts.
Example scripts can be found at https://www.mongodb.com/docs/mongodb-shell/write-scripts/ and https://www.mongodb.com/docs/manual/reference/method/.
docker-compose -f docker-compose.migrate.yml up
https://documentation.red-gate.com/flyway/flyway-cli-and-api/usage/command-line
flyway -url=jdbc:mongodb://localhost:27017/test -locations=filesystem:./db/js -configFiles="./db/config/local/flyway.toml" migrate info
See https://dev.to/chetan07/automating-database-migrations-with-flyway-and-github-actions-550p for example.