restore data from mongodb-backup
npm install mongodb-restore




Restore data from mongodb-backup
Look at mongodb-restore-cli for command line usage, similar to mongorestore
Install through NPM
``bash`
npm install mongodb-restore`
orbash`
git clone git://github.com/hex7c0/mongodb-restore.git
Bson@0.4.11 has been pulled out, so versions >= 1.3.0 and <= 1.4.1 are deprecate
inside nodejs project
`js
var restore = require('mongodb-restore');
restore({
uri: 'uri', // mongodb://
root: __dirname + '/dbName'
});
`
#### options
- uri - String URI for MongoDb connection (default "required")root
- - String Path where get the backup (default "required")[parser]
- - String | Function Data parser (bson, json) or custom (default "bson")[callback]
- - Function Callback when done (default "disabled")[stream]
- - Object Get .tar file from Node stream (default "disabled")[tar]
- - String Extract files from a .tar file (default "disabled")[logger]
- - String Path where save a .log file (default "disabled")[metadata]
- - Boolean Set metadata of collections as Index, ecc (default "false")[drop]
- - Boolean Drop every collection from the target database before restoring the collection (default "false")[dropCollections]
- - Boolean|Array Drop every collection from the target database before restoring if Boolean (similar to drop option), or selected collections if Array (default "false")[options]` - Object MongoDb options (default)
-
Take a look at my examples