A MongoDB migration framework for Node.js. Version 2.0.2 (latest) is stable but in legacy maintenance mode — the package has not been updated since 2015 and the GitHub repository is archived. It provides a simple up/down migration pattern inspired by visionmedia/node-migrate, storing migration state in a MongoDB collection. Alternatives like migrate-mongo offer modern ESM support, async/await, and active maintenance. Key differentiator: direct MongoDB driver integration via db object in migration functions.
npm install mongo-migrateNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a migration file with up and down functions, then runs migrations via CLI.
Switch to migrate-mongo: npm install migrate-mongo
Use an older MongoDB server or migrate to a maintained library.
Use -cfg config.json or set environment variables.
Ensure proper error handling; test migrations in a staging environment.
Always include -runmm in command: node ./node_modules/mongodb-migrate -runmm up
Run from project root: node ./node_modules/mongodb-migrate -runmm up
Use db.collection('name') (lowercase) for MongoDB 2.x+.Start mongod or check host/port in config or -dbc JSON.
Use npx: npx mongodb-migrate -runmm up, or run via relative path.