๐ฏRun a single filemmk up and mmk down โ not just "all pending" or "the last batch". Full control over exactly what runs.mmk up
โฉ๏ธReal rollbacksRevert any batch (--batch 3), the last N migrations (--steps 2), a single file, or redo in one step โ history is never deleted.mmk down
๐Dry-run previewsmmk dry-run up shows precisely what would run before anything touches the database. No surprises in production.mmk dry-run
๐Safe by defaultAn atomic MongoDB lock with a renewal heartbeat stops two deploys racing, and SHA-256 checksums catch edited migrations before they re-run.Locking & unlock
๐Opt-in transactionsWrap a migration in a MongoDB transaction with export const useTransaction = true โ automatic commit on success, abort on error.Transactions
๐ชLifecycle hooksbeforeAll, afterAll, beforeEach, afterEach, and onError โ plug in logging, metrics, or notifications around every run.Lifecycle hooks
๐งพAudit-ready historyEvery run records duration, checksum, environment, user, and batch in an append-only changelog. A rollback updates the record, never removes it.mmk status
๐TypeScript & JavaScript.ts (native on Node 22.18+, or via a loader like tsx), ESM, and CommonJS all just work, with a fully-typed context and config.Writing migrations
๐ฆAdopt migrate-mongommk import brings an existing migrate-mongo changelog forward as-is โ no re-running, no data loss, no rewriting files.Migrate from migrate-mongo