object-stream-to-fs
Version:
Stream objects to a file and store it to be read from JSONStream
13 lines (8 loc) • 291 B
JavaScript
var objectStreamToFS = require('../');
var dump = require('mongodb-collection-dump');
var s = objectStreamToFS('/tmp/test-file');
var d = dump('mongodb://127.0.0.1/test_db', 'testcollection');
d.pipe(s);
s.on('done', function(){
console.log("the object stream has been consumed!")
});