@nullx/mongodb-backup

1.0.2 • Public • Published

@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

License Apache2

Readme

Keywords

Package Sidebar

Install

npm i @nullx/mongodb-backup

Weekly Downloads

1

Version

1.0.2

License

Apache-2.0

Unpacked Size

48.6 kB

Total Files

7

Last publish

Collaborators

  • nullx