#mongodb-collection-dump
dumps a mongodb collection to a stream.
Specify a mongoDB connect URI, the collection, and a path to the target file.
Dump a collection to stream:
var d = dump('mongodb://127.0.0.1/test_db', 'testcollection').pipe(through(write));
function write(row) {
console.log(row);
}
d.on('end', function() {
console.log("done");
});
var dump = require('mongodb-collection-dump')
dump connects to the mongodb database at connectURI
and begins streaming the entire collection
.
The returned object s
is a Stream.
d.on(Stream events)
Any event Stream normally emits.
Emitted when there is a error connecting to the database.
With npm do:
npm install mongodb-collection-dump
MIT