@nullx/mongodb-restore

1.0.1 • Public • Published

mongodb-restore

Restore data from mongodb-backup

Installation

Install through NPM

npm install @nullx/mongodb-restore

or

git clone git://github.com/nullxx/mongodb-restore.git

API

inside nodejs project

var restore = require('@nullx/mongodb-restore');

restore({
  uri: 'uri', // mongodb://<dbuser>:<dbpassword>@<dbdomain>.mongolab.com:<dbport>/<dbdatabase>
  root: __dirname + '/dbName'
});

restore(options)

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)

Examples

Take a look at my examples

License Apache2

Readme

Keywords

Package Sidebar

Install

npm i @nullx/mongodb-restore

Weekly Downloads

3

Version

1.0.1

License

Apache-2.0

Unpacked Size

41.1 kB

Total Files

7

Last publish

Collaborators

  • nullx