
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
mongodb-restore-dump
Advanced tools
Simple module to restore MongoDB dumps from BSON files.
npm install --save mongodb-restore-dump
const restore = require('mongodb-restore-dump'),
uri = 'mongodb://127.0.0.1:27001/';
// restore multi-database dump
await restore.dump({
uri,
from: '../dumps/mydump/'
});
// restore single database
await restore.database({
uri,
database: 'my-database-name',
from: '../dumps/mydump/db-1/'
});
// restore single collection
await restore.collection({
uri,
database: 'my-database-name',
collection: 'foo',
from: '../dumps/mydump/db-1/foo.bson'
});
await restore.dump({
con: await MongoClient.connect(uri),
// An existing mongodb connection to use.
// Either this or "uri" must be provided
uri: 'mongodb://127.0.0.1:27001/',
// URI to the Server to use.
// Either this or "con" must be provided.
from: '../dumps/my-dump',
// path to the server dump, contains sub-directories
// that themselves contain individual database
// dumps
clean: true // wether the collections should be cleaned before
// inserting the documents from the dump files
// optional; default = true
});
await retore.database({
con, uri, clean, // same as in dump()
database: 'my-database-name',
// name of the database that will be created
// on the mongodb server from the dump
from: '../dumps/mydump/db-1/',
// path to the database dump directory
// should contain one or more bson files
// to restore
});
await retore.collection({
con, uri, clean, database, // same as in database()
collection: 'my-collection-name',
// name of the collection that the documents
// will be restored into
from: '../dumps/mydump/db-1/foo.bson',
// bson file containingt the documents
// to be restored
limit: 100, // optionally you can choose to not
// restore all the documents but just
// the first e.g. 100
// optional; default = no limit
});
FAQs
restore mongodb bson dumps
The npm package mongodb-restore-dump receives a total of 4,052 weekly downloads. As such, mongodb-restore-dump popularity was classified as popular.
We found that mongodb-restore-dump demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.