MongoDB patching tool (v2.0.2) for declarative document migration via small, versioned JavaScript patches. Enables updates with query filtering, before/after hooks, and diff tracking. Current stable release is 2.0.2 (last updated 2018), with critical warnings about broken tests on MongoDB 2.6 and 3.4. Maintained primarily for internal use by debitoor. Release cadence is low; no new versions in several years. Not actively maintained. Differentiator: simple, git-friendly migration approach vs. mongodb-migrate or db-migrate.
npm install mongopatchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to create and run a simple migration patch using mongopatch CLI: renames a field in all user documents.
Test thoroughly on your MongoDB version; avoid production on unsupported versions
Always call patch.version() with a semver string; track versions manually
Backup the database or use a test environment before running patches
Consider alternatives like mongodb-migrate or write custom migration scripts
Install globally: npm install -g mongopatch
Ensure the callback second argument is a valid MongoDB update operator or the full document
Export a function that takes `patch` as argument and call patch.version() inside
Check MongoDB version compatibility; ensure server is running and accessible