Backup MongoDB databases to BSON or JSON files with optional tar packing and streaming. v3.2.1 supports Node >=4 and uses the native MongoDB driver. Key differentiators: supports parallel collection scan, metadata (indexes) saving, and query-based filtering. Alternatives: mongodump CLI, mongodb-backup-cli for command line.
npm install mongodb-backup-4xNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic backup of a MongoDB database to BSON files in a local directory.
Upgrade to v3.2.1 or later.
Use import backup from 'mongodb-backup' instead of require('mongodb-backup').Set parser: 'json' in options object.
Run 'npm install mongodb-backup' and ensure import/require uses correct case.
Use 'import backup from' or 'const backup = require(...).default'.
Start MongoDB or correct the URI in options.
Verify URI includes database name and connection works.