Skip to content
Stream objects to a Mongo database
JavaScript Makefile
Failed to load latest commit information.
test
.gitignore initial commit Jul 30, 2013
.travis.yml add travis config Jul 30, 2013
Makefile initial commit Jul 30, 2013
README.md Update README.md Jul 30, 2013
index.js 0.1.4 - Ends the mongodb connection on finish Apr 19, 2014
package.json

README.md

StreamToMongo

Stream objects straight into a MongoDB database.

Build
Status

Install

npm install stream-to-mongo

Main usecase

Seeding a database from large HTTP response or JSON file.

Example

var request = require('request')
var parser = require('JSONStream').parse('rows.*.doc')
var options = { db: 'mongodb://localhost:27017/test-stream', collection: 'docs' }
var streamToMongo = require('stream-to-mongo')(options);

request('http://isaacs.couchone.com/registry/_all_docs')
  .pipe(parser)
  .pipe(streamToMongo);

Test

Needs a MongoDB instance running. make test

License

MIT

Something went wrong with that request. Please try again.