@nullx/mongodb-backup
v1.0.2
Published
backup for mongodb
Downloads
10
Readme
@nullx/mongodb-backup
Backup for mongodb
Installation
Install through NPM
npm install @nullx/mongodb-backup
API
inside nodejs project
var backup = require('@nullx/mongodb-backup');
backup({
uri: 'uri', // mongodb://<dbuser>:<dbpassword>@<dbdomain>.mongolab.com:<dbport>/<dbdatabase>
root: __dirname
});
backup(options)
options
uri
- String URI for MongoDb connection (default "required")root
- String Path where save data (default "required")[parser]
- String | Function Data parser (bson, json) or custom (default "bson")[collections]
- Array Select which collections save (default "disabled")[callback]
- Function Callback when done (default "disabled")[stream]
- Object Send.tar
file to Node stream (default "disabled")[tar]
- String Pack files into a .tar file (default "disabled")[query]
- Object Query that optionally limits the documents included (default "{}")[numCursors]
- Number Set number of cursor for parallelCollectionScan without query (default "disabled")[logger]
- String Path where save a .log file (default "disabled")[metadata]
- Boolean Save metadata of collections as Index, ecc (default "false")[options]
- Object MongoDb options (default)
Examples
Take a look at the examples folder