A TypeScript-first MongoDB migration library supporting up/down migrations with configurable logging and database connections. Current stable version 7.0.0 (semver), requires Node >=20, peer dependency on mongodb driver ^5 || ^6 || ^7. Differentiators: built-in logger, esm/cjs support, types included, simple API with both singleton and instance usage. Actively maintained with CI.
npm install mgdb-migratorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows configuration, migration definition (up/down), and execution to latest version
Upgrade Node to v20+ or pin to v6.x
Await migrator.config() or use .then()
Call migrator.add separately for each migration
Use migrateTo(versionNumber) for target version; down migrations run if needed
Install with npm install mgdb-migrator or use relative path if local
Use import { migrator } from 'mgdb-migrator'Enable peer dependency: npm install mongodb@^6