Home

Awesome

mongo-write-stream

build status

Node.js module that creates a writable object stream to a mongodb collection.

npm install mongo-write-stream

Example.

var mongoWriteStream = require('mongo-write-stream');
var collectionWriteStream = mongoWriteStream('mongodb://hostname/mydb');

someObjectReadableStream.pipe(collectionWriteStream('collectionName'));

Instead of a connection string you can also pass a mongodb native driver database instance or a mongojs database instance to avoid duplicate connections.