A Node.js library for creating backups of MongoDB databases by programmatically invoking mongodump-like functionality. Current stable version is 1.6.9, with a history of weekly or monthly releases. It supports streaming backups, tar packaging, collection selection, query filtering, and metadata preservation. Compared to direct mongodump usage, it provides a JavaScript API suitable for integration into build processes or deployment scripts. Requires Node >=4 and uses BSON for binary data serialization.
npm install mongodb-backupNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to perform a basic MongoDB backup using the mongodb-backup library, including URI authentication, collection filtering, query limitation, and JSON parser for readable output.
Upgrade to version >=1.5.0.
Add parser: 'json' to the options object.
Ensure your URI string includes username, password, host, port, and database name in the correct format.
Update your code to expect backups in a subdirectory of the specified root, e.g., root/dbname.
Ensure you pass a proper writable stream, e.g., fs.createWriteStream('backup.tar').Upgrade Node.js to version >=4.
List collections in your database and correct the 'collections' option.
Use 'const backup = require('mongodb-backup');'Add a 'root' property specifying the directory path for the backup.
No dependency data recorded yet.