Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hex7c0/mongodb-restore
restore data from mongodb-backup for Nodejs
https://github.com/hex7c0/mongodb-restore
mongodb nodejs restore
Last synced: 1 day ago
JSON representation
restore data from mongodb-backup for Nodejs
- Host: GitHub
- URL: https://github.com/hex7c0/mongodb-restore
- Owner: hex7c0
- License: apache-2.0
- Created: 2014-12-26T10:35:36.000Z (about 10 years ago)
- Default Branch: 1.6
- Last Pushed: 2024-04-09T19:05:45.000Z (9 months ago)
- Last Synced: 2024-12-26T03:06:26.713Z (8 days ago)
- Topics: mongodb, nodejs, restore
- Language: JavaScript
- Homepage: https://github.com/hex7c0/mongodb-restore
- Size: 168 KB
- Stars: 53
- Watchers: 3
- Forks: 21
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# [mongodb-restore](https://github.com/hex7c0/mongodb-restore)
[![NPM version](https://img.shields.io/npm/v/mongodb-restore.svg)](https://www.npmjs.com/package/mongodb-restore)
[![Linux Status](https://img.shields.io/travis/hex7c0/mongodb-restore.svg?label=linux)](https://travis-ci.org/hex7c0/mongodb-restore)
[![Windows Status](https://img.shields.io/appveyor/ci/hex7c0/mongodb-restore.svg?label=windows)](https://ci.appveyor.com/project/hex7c0/mongodb-restore)
[![Dependency Status](https://img.shields.io/david/hex7c0/mongodb-restore.svg)](https://david-dm.org/hex7c0/mongodb-restore)
[![Coveralls](https://img.shields.io/coveralls/hex7c0/mongodb-restore.svg)](https://coveralls.io/r/hex7c0/mongodb-restore)Restore data from [`mongodb-backup`](https://github.com/hex7c0/mongodb-backup)
Look at [`mongodb-restore-cli`](https://github.com/hex7c0/mongodb-restore-cli) for command line usage, similar to [mongorestore](http://docs.mongodb.org/manual/reference/program/mongorestore/)
## Installation
Install through NPM
```bash
npm install mongodb-restore
```
or
```bash
git clone git://github.com/hex7c0/mongodb-restore.git
```[email protected] has been pulled out, so versions >= `1.3.0` and <= `1.4.1` are deprecate
## API
inside nodejs project
```js
var restore = require('mongodb-restore');restore({
uri: 'uri', // mongodb://:@.mongolab.com:/
root: __dirname + '/dbName'
});
```### restore(options)
#### options
- `uri` - **String** [URI](http://mongodb.github.io/node-mongodb-native/2.0/tutorials/urls/) 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](http://mongodb.github.io/node-mongodb-native/2.0/tutorials/connecting/#toc_7) *(default)*## Examples
Take a look at my [examples](examples)
### [License Apache2](LICENSE)