adamvr-stream-to-mongo

0.1.8 • Public • Published

StreamToMongo

Stream objects straight into a MongoDB database.

BuildStatus

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.8
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.8
    1
  • 0.1.7
    0
  • 0.1.6
    0
  • 0.1.5
    0

Package Sidebar

Install

npm i adamvr-stream-to-mongo

Weekly Downloads

1

Version

0.1.8

License

MIT

Last publish

Collaborators

  • adamvr