mongo-migration (v0.0.3) is a lightweight MongoDB migration tool for Node.js, designed for simple schema and data migrations. It uses MongoDB driver v3 and focuses on file-based migration management with support for adding migration files and tracking executed migrations in a dedicated collection. Notable features include migration cleanup to synchronize the database state with existing migration files. This package is minimal and unopinionated, suitable for small projects, but lacks advanced features like rollback, CLI, or TypeScript types. Development appears to be early-stage with no recent releases.
npm install mongo-migrationNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a Migration instance, add migration files, and run migrations using async/await. Requires MongoDB connection URL and database name.
Consider switching to Renovate or Dependabot for automated dependency updates.
Manually write reverse migration scripts and execute them separately if needed.
Create a .d.ts file or use // @ts-ignore.
Ensure mongodb package version ^3.x is installed. For MongoDB 5+, consider alternative migration tools.
Run: npm install mongo-migration
Use: import { Migration } from 'mongo-migration'Include username and password in the URL, e.g., mongodb://user:pass@localhost:27017