{"_id":"@ai-lion/mongodb-restore","_rev":"2-a0db52c063ddb21537cac892c53335ba","name":"@ai-lion/mongodb-restore","dist-tags":{"latest":"1.2.0"},"versions":{"1.1.2":{"name":"@ai-lion/mongodb-restore","version":"1.1.2","description":"restore mongodb bson dumps","main":"src/index.js","scripts":{"test":"npx mocha --bail src/*.spec.js"},"author":{"name":"Jan Schwalbe"},"license":"MIT","keywords":["mongo","mongodb","mongorestore","mongodump"],"devDependencies":{"chai":"^4.3.4","mocha":"^8.4.0","mongodb-memory-server":"^6.9.6"},"dependencies":{"bson":"^4.4.0","mongodb":"~3.6.9"},"repository":{"type":"git","url":"git+https://github.com/ai-lion/mongodb-restore.git"},"bugs":{"url":"https://github.com/ai-lion/mongodb-restore/issues"},"homepage":"https://github.com/ai-lion/mongodb-restore#readme","gitHead":"faf0f902aa3efeca99ab0b99db6c0794de1e6255","_id":"@ai-lion/mongodb-restore@1.1.2","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-SiBPBs5VvOmxQStQwPlgLmQBQOGJCbQI7xjxiVIym1ouAudsVAEB1GmP/5hNNXcdcCdKh5EA/8Hw2+6zcDgijQ==","shasum":"843809729880f2878ece1ce1181aee345e041c1a","tarball":"https://registry.npmjs.org/@ai-lion/mongodb-restore/-/mongodb-restore-1.1.2.tgz","fileCount":20,"unpackedSize":384671,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxxIdCRA9TVsSAnZWagAAs64P/22UyVXgeBfcvqB6wch9\nqfScO5xwpZWyOWNkWpR2u+452ZPmK9j6eHz0/Q2w6/ie6IUaGSAp4j3R1/5L\n3+NBZpOOk0zGgTM8neomQc5uKyiKhz1C1SivGgAUfSKMbDcuD57U6i7N0Kdh\nDeisH0LGWxDgWPchwl2kaF6XBn4Le7grvSLSNe2c3GB4+omss5S04N9uHD47\n1m5svKlrjPdkXLIerHG55YCwiiayKMdHWnpErjcCMJaPWFqEcqDu4FUMw4UM\nw3S+s/Jd3o9lo6hJBhuOIk5mKpb8gmmS6EwQMEg40X4UJMCHvsZJCS+F0Lz8\nDg6i8Am0UBGgp1PdUF86LtrlLkR+0bCjNVoyqd3OyKHvl4PcNrWHA4tQHbLP\nu2kI3d943qlKO4gK+YeMbn9lOO0TPtUS1PHNL05F3OT5rYdNoCWSpRsdRs1Q\nrJOFwZQuuD8IbpsbUkMkfoem5g11feBhMT/4U//KSZG3v5VHhTk2WoipjnuP\n86nRUCTMHIgWsDXNs7RQ7xZJuol88bCJpevPFGcY8rRCwMtTe8iyeAMFPhu7\n18V1HY1I+HOdIvPCV7KaMpt7OYLbtflXSdPn32VSHDb6yZVOkzPTMUiR1xoG\n2JtwkXb/FeggxvclfckxF/Rm0TuHRUVQyq0a4QmnPCZYVuNt+f+zZ9FK1DUU\nqwaf\r\n=QPLS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBgedPJttLFa+HStkM5R4uCIAmmTyWmWpmFQs7FxRQQpAiEA1I55NGEp5McPvuweq6Qi0UNeOhfIGZbXXVE6rHG33TA="}]},"_npmUser":{"name":"ai-lion","email":"markchen0312@gmail.com"},"directories":{},"maintainers":[{"name":"ai-lion","email":"markchen0312@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongodb-restore_1.1.2_1623659037399_0.9028287201799423"},"_hasShrinkwrap":false},"1.2.0":{"name":"@ai-lion/mongodb-restore","version":"1.2.0","description":"restore mongodb bson dumps","main":"src/index.js","scripts":{"test":"npx mocha --bail src/*.spec.js"},"author":{"name":"Jan Schwalbe"},"license":"MIT","keywords":["mongo","mongodb","mongorestore","mongodump"],"devDependencies":{"chai":"^4.3.4","mocha":"^8.4.0","mongodb-memory-server":"^6.9.6"},"dependencies":{"bson":"^4.4.0","mongodb":"~3.6.9"},"repository":{"type":"git","url":"git+https://github.com/ai-lion/mongodb-restore.git"},"bugs":{"url":"https://github.com/ai-lion/mongodb-restore/issues"},"homepage":"https://github.com/ai-lion/mongodb-restore#readme","gitHead":"8455ccc75f8fb0ab05a49be7496d9722131c10eb","_id":"@ai-lion/mongodb-restore@1.2.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-2/ch082ovv6Q5XSCPwY56Pz304d9D0sUBvdApWYq9CrvqnWKF/4QWNdxuuaBt3NjB5TNnQJ+8qVTVGi58a0KZg==","shasum":"560c960a01aa13a5120db4aec6ab8639e539e383","tarball":"https://registry.npmjs.org/@ai-lion/mongodb-restore/-/mongodb-restore-1.2.0.tgz","fileCount":20,"unpackedSize":385139,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx/JnCRA9TVsSAnZWagAAf98QAIxSjdCz8KCJGMz3KNjL\n9ALDWCyq0lGZzSG6/bmKOZxrOjOnNzRgyuiT+yyjxEsuzElIoq8VO9bskYsc\nFyFU3j+u5EYFSVqy3N90D3xVjUGbO2lfF7+6pNDMXlpo8SrzOp7Jip5oulr9\nF2/GYpkCrQtX/zjzFxeqoa4NuEsnVtK3COuy9NTJftck5pzwisNSs9C5BthL\n+ymSxKypGMXUgnMx7+/RaRtHL9NWDz6oqTPoJQ2d368gApq7kac/YGuerJYj\nlyF4w72Ku8FawuthP8Ltd5suLNEfwaUc4l6jAuxFM1Vz0FPjR1puXAREesD6\nY4FlReEXSa3Eya9bIg/fP2CeHXrSInd5LMvJQQGjGlb0AscRf+EsIRNw/nXQ\nU7Iv30b6jdL5dCC7ene5qfIuZ5ocEg6ePhK4B5VgpadNg2ACr3TU8qfztJ+5\nF9Ng48NkP7NCgbbyoTgp9Kx0aqcb1YJCEt6mZaagcqyodjkhxREY2eXGUSTK\nKqchryV44mnN21bxWjCJ6VMLTgKVFdFd0jxoJQVT0S2bgGzSEyo6dcg4K7y9\nQlw4R506SNFozLpRtT84FwfOo7NT7KmFRH7+M1Iis6J0PauKsUv6IbAuWy2x\n92Woe3fR15/CTtVbhYd3EiOWfBU5AyJV9HYrqPT3YCVoaXgQOrHRxpFTzxhm\nUCqZ\r\n=rDCF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxLZM0PHQ/XJJwd1dk9BakvfOf3OYtxjmXVSisti6HHAiEAiOcWN5kDhpGOvAaKOQewYmhRSXnxU/983EGgeMiYDhs="}]},"_npmUser":{"name":"ai-lion","email":"markchen0312@gmail.com"},"directories":{},"maintainers":[{"name":"ai-lion","email":"markchen0312@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mongodb-restore_1.2.0_1623716454975_0.30293987767710684"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-14T08:23:57.262Z","1.1.2":"2021-06-14T08:23:57.654Z","modified":"2022-04-04T12:14:52.849Z","1.2.0":"2021-06-15T00:20:55.123Z"},"maintainers":[{"name":"ai-lion","email":"markchen0312@gmail.com"}],"description":"restore mongodb bson dumps","homepage":"https://github.com/ai-lion/mongodb-restore#readme","keywords":["mongo","mongodb","mongorestore","mongodump"],"repository":{"type":"git","url":"git+https://github.com/ai-lion/mongodb-restore.git"},"author":{"name":"Jan Schwalbe"},"bugs":{"url":"https://github.com/ai-lion/mongodb-restore/issues"},"license":"MIT","readme":"# @ai-lion/mongodb-restore\n\nSimple module to restore MongoDB dumps from BSON files.\n\n## Installation\n\n    npm install --save @ai-lion/mongodb-restore\n    \n## Usage\n\n```javascript\nconst restore = require('@ai-lion/mongodb-restore'),\n      uri = 'mongodb://127.0.0.1:27001/';\n\n// restore multi-database dump\nawait restore.dump({\n    uri,\n    from: '../dumps/mydump/'\n});\n\n// restore single database\nawait restore.database({\n    uri,\n    database: 'my-database-name',\n    from: '../dumps/mydump/db-1/'\n});\n\n// restore single collection\nawait restore.collection({\n    uri,\n    database: 'my-database-name',\n    collection: 'foo',\n    from: '../dumps/mydump/db-1/foo.bson'\n});\n```\n\n## Parameters\n```javascript\nawait restore.dump({\n    con: await MongoClient.connect(uri),\n                  // An existing mongodb connection to use.\n                  // Either this or \"uri\" must be provided\n    uri: 'mongodb://127.0.0.1:27001/',\n                  // URI to the Server to use.\n                  // Either this or \"con\" must be provided.\n    from: '../dumps/my-dump',\n                  // path to the server dump, contains sub-directories\n                  // that themselves contain individual database\n                  // dumps\n    clean: true,   // wether the collections should be cleaned before\n                  // inserting the documents from the dump files\n                  // optional; default = true\n    onCollectionExists: 'throw',\n                  // how to handle collections that already exist\n                  // on the server; when set to \"throw\" (default)\n                  // the restore will throw an error;\n                  // when set to \"overwrite\" the restore will proceed\n                  // and insert the dump data to the collection\n                  // (and remove existing items when clean == true)\n                  // optional, default: 'throw'\n                  // available options:\n                  //    'throw'\n                  //    'overwrite'\n});\n\nawait retore.database({\n    con, uri, clean, onCollectionExists, // same as in dump()\n    \n    database: 'my-database-name',\n                  // name of the database that will be created\n                  // on the mongodb server from the dump\n    from: '../dumps/mydump/db-1/',\n                  // path to the database dump directory\n                  // should contain one or more bson files\n                  // to restore\n});\n\nawait restore.collection({\n    con,\n    uri,\n    clean,\n    onCollectionExists,\n    database,\n    // above are the same as in database()\n    \n    collection: 'my-collection-name',\n                  // name of the collection that the documents\n                  // will be restored into\n    from: '../dumps/mydump/db-1/foo.bson',\n                  // bson file containingt the documents\n                  // to be restored\n    limit: 100,   // optionally you can choose to not\n                  // restore all the documents but just\n                  // the first e.g. 100\n                  // optional; default = no limit\n});\n```","readmeFilename":"README.md"}