Skip to content
Dumps a mongodb collection to a stream.
JavaScript Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
test dump now returns a stream Aug 21, 2013
.travis.yml
LICENSE initial commit Aug 20, 2013
README.md
index.js
package.json

README.md

#mongodb-collection-dump

dumps a mongodb collection to a stream.

Specify a mongoDB connect URI, the collection, and a path to the target file.

build status

example

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");
});

methods

var dump = require('mongodb-collection-dump')

var d = dump(connectURI, collection)

dump connects to the mongodb database at connectURI and begins streaming the entire collection.

The returned object s is a Stream.

events

d.on(Stream events)

Any event Stream normally emits.

d.on('connectError', function (err) {})

Emitted when there is a error connecting to the database.

install

With npm do:

npm install mongodb-collection-dump

license

MIT

You can’t perform that action at this time.