A database migration tool for MongoDB in Node.js (fork of migrate-mongo). Version 12.0.3 supports Node >=18 and MongoDB drivers 4.4.x through 7.x. It provides a CLI for creating, up/down migrations, and status checks. Differentiators include merged PRs from the original project, optional context function per migration, and support for ESM or CJS configs. Release cadence is irregular; actively maintained as of 2025.
npm install migrate-mongo-altNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize a migration project, create a migration file, and apply it.
Use module.exports = { ... } or an async function returning the config.Use an absolute path in migrationsDir or run the CLI from the correct directory.
Set directConnection: false and provide a valid replica set URI or seed list.
Update context to accept a single object parameter: { migrationFile, operation }.Upgrade Node.js to >=18.
Install mongodb driver version 4.4.1 or later.
Use the provided 'db' parameter. Avoid calling client.db() unless necessary.
Run with npx: npx migrate-mongo up
Set directConnection: false or remove the option.
Run npm install migrate-mongo-alt (or add it to package.json).
Use correct import: import { up } from 'migrate-mongo-alt';