A simple Node.js package to backup, restore, and schedule MongoDB database snapshots using mongodump and mongorestore. Current stable version: 1.0.3 (infrequently updated). It wraps native MongoDB CLI tools, offering a simplified API for common backup operations and cron-based scheduling. Compared to alternatives like mongodump directly or mongodb-backup, this package adds minimal abstraction but lacks authentication support, TLS/SSL, and cloud storage options.
npm install mongodb-backup-dumpNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic backup, restore, and scheduled backup using mongodb-backup-dump with both default and custom parameters.
Use mongodump/mongorestore directly with --username and --password flags, or use a more comprehensive backup solution.
Install via npm or yarn only.
Wrap calls in try/catch blocks or use .catch() if promises are involved (note: the package uses callbacks, not promises).
Ensure the parent directory exists or use an absolute path for the backupDest parameter.
Install MongoDB Database Tools (mongodump and mongorestore) and ensure they are in your PATH.
Run 'npm install' again, or manually install 'npm install cron@1.8.2' (the version used by this package).
Use the default require: const mongodbBackup = require('mongodb-backup-dump'); then call mongodbBackup.createBackup().Start MongoDB (mongod) or specify a correct host and port.