# mongodb-restore

> restore data from mongodb-backup

Latest version **1.6.2** (published 2016-12-13) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install mongodb-restore
pnpm add mongodb-restore
yarn add mongodb-restore
bun add mongodb-restore
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.2 |
| Published | 2016-12-13 |
| First published | 2014-12-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+20 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 53 |
| Author | hex7c0 |
| Maintainers | hex7c0 |
| Keywords | mongodb, restore, dump |

## Links

- npm: https://www.npmjs.com/package/mongodb-restore
- Repository: https://github.com/hex7c0/mongodb-restore
- Issues: https://github.com/hex7c0/mongodb-restore/issues
- npm.io page: https://npm.io/package/mongodb-restore

## Dependencies (5)

- [tar](https://npm.io/package/tar.md) 2.2.1
- [bson](https://npm.io/package/bson.md) 1.0.1
- [mongodb](https://npm.io/package/mongodb.md) 2.2.16
- [graceful-fs](https://npm.io/package/graceful-fs.md) 4.1.11
- [logger-request](https://npm.io/package/logger-request.md) 3.7.3

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 1.6.2 (latest) — 2016-12-13
- 1.4.6 (stable) — 2016-07-31
- 1.6.1 — 2016-11-08
- 1.6.0 — 2016-10-30
- 1.5.6 — 2016-09-21
- 1.5.5 — 2016-09-13
- 1.5.4 — 2016-07-31
- 1.5.3 — 2016-04-25
- 1.5.2 — 2016-02-07
- 1.4.5 — 2016-02-07
- 1.4.4 — 2016-01-06
- 1.5.1 — 2016-01-06
- 1.5.0 — 2015-12-29
- 1.4.3 — 2015-12-27
- 1.4.2 — 2015-10-07
- … 14 more at https://npm.io/package/mongodb-restore/versions

## 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-osx)](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
```

Bson@0.4.11 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://<dbuser>:<dbpassword>@<dbdomain>.mongolab.com:<dbport>/<dbdatabase>
  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)

---
_Source: https://npm.io/package/mongodb-restore · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
