{"id":21905377,"url":"https://github.com/hex7c0/mongodb-restore","last_synced_at":"2025-04-07T17:12:23.782Z","repository":{"id":25087180,"uuid":"28507968","full_name":"hex7c0/mongodb-restore","owner":"hex7c0","description":"restore data from mongodb-backup for Nodejs","archived":false,"fork":false,"pushed_at":"2024-04-09T19:05:45.000Z","size":172,"stargazers_count":53,"open_issues_count":12,"forks_count":21,"subscribers_count":2,"default_branch":"1.6","last_synced_at":"2025-03-31T14:15:04.153Z","etag":null,"topics":["mongodb","nodejs","restore"],"latest_commit_sha":null,"homepage":"https://github.com/hex7c0/mongodb-restore","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hex7c0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-26T10:35:36.000Z","updated_at":"2022-11-28T16:23:05.000Z","dependencies_parsed_at":"2024-06-18T15:15:00.390Z","dependency_job_id":"a7d95e6d-2ccf-42b8-92f1-6fd7361e7197","html_url":"https://github.com/hex7c0/mongodb-restore","commit_stats":{"total_commits":231,"total_committers":2,"mean_commits":115.5,"dds":"0.017316017316017285","last_synced_commit":"f67183bd8fcff89ce9bf2ccc79ab8691488d7667"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hex7c0%2Fmongodb-restore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hex7c0%2Fmongodb-restore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hex7c0%2Fmongodb-restore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hex7c0%2Fmongodb-restore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hex7c0","download_url":"https://codeload.github.com/hex7c0/mongodb-restore/tar.gz/refs/heads/1.6","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694877,"owners_count":20980733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mongodb","nodejs","restore"],"created_at":"2024-11-28T16:33:05.624Z","updated_at":"2025-04-07T17:12:23.758Z","avatar_url":"https://github.com/hex7c0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [mongodb-restore](https://github.com/hex7c0/mongodb-restore)\n\n[![NPM version](https://img.shields.io/npm/v/mongodb-restore.svg)](https://www.npmjs.com/package/mongodb-restore)\n[![Linux Status](https://img.shields.io/travis/hex7c0/mongodb-restore.svg?label=linux)](https://travis-ci.org/hex7c0/mongodb-restore)\n[![Windows Status](https://img.shields.io/appveyor/ci/hex7c0/mongodb-restore.svg?label=windows)](https://ci.appveyor.com/project/hex7c0/mongodb-restore)\n[![Dependency Status](https://img.shields.io/david/hex7c0/mongodb-restore.svg)](https://david-dm.org/hex7c0/mongodb-restore)\n[![Coveralls](https://img.shields.io/coveralls/hex7c0/mongodb-restore.svg)](https://coveralls.io/r/hex7c0/mongodb-restore)\n\nRestore data from [`mongodb-backup`](https://github.com/hex7c0/mongodb-backup)\n\nLook 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/)\n\n## Installation\n\nInstall through NPM\n\n```bash\nnpm install mongodb-restore\n```\nor\n```bash\ngit clone git://github.com/hex7c0/mongodb-restore.git\n```\n\nBson@0.4.11 has been pulled out, so versions \u003e= `1.3.0` and \u003c= `1.4.1` are deprecate\n\n## API\n\ninside nodejs project\n```js\nvar restore = require('mongodb-restore');\n\nrestore({\n  uri: 'uri', // mongodb://\u003cdbuser\u003e:\u003cdbpassword\u003e@\u003cdbdomain\u003e.mongolab.com:\u003cdbport\u003e/\u003cdbdatabase\u003e\n  root: __dirname + '/dbName'\n});\n```\n\n### restore(options)\n\n#### options\n\n - `uri` - **String** [URI](http://mongodb.github.io/node-mongodb-native/2.0/tutorials/urls/) for MongoDb connection *(default \"required\")*\n - `root`- **String** Path where get the backup *(default \"required\")*\n - `[parser]` - **String | Function** Data parser (bson, json) or custom *(default \"bson\")*\n - `[callback]` - **Function** Callback when done *(default \"disabled\")*\n - `[stream]`- **Object** Get `.tar` file from Node stream *(default \"disabled\")*\n - `[tar]` - **String** Extract files from a .tar file *(default \"disabled\")*\n - `[logger]` - **String** Path where save a .log file *(default \"disabled\")*\n - `[metadata]` - **Boolean** Set metadata of collections as Index, ecc *(default \"false\")*\n - `[drop]` - **Boolean** Drop every collection from the target database before restoring the collection *(default \"false\")*\n - `[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\")*\n - `[options]` - **Object** MongoDb [options](http://mongodb.github.io/node-mongodb-native/2.0/tutorials/connecting/#toc_7) *(default)*\n\n## Examples\n\nTake a look at my [examples](examples)\n\n### [License Apache2](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhex7c0%2Fmongodb-restore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhex7c0%2Fmongodb-restore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhex7c0%2Fmongodb-restore/lists"}