mongoose-write-stream
mongoose-write-stream =====================
Last updated 7 years ago by ashaffer88 .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mongoose-write-stream 
SYNC missed versions from official npm registry.

mongoose-write-stream

Super simple mongoose plugin that adds writable streams to your models.

Example

var mongoose = require('mongoose');
var csv      = require('csv-stream');
var request  = require('request');
var zlib     = require('zlib');

mongoose.connect('mongodb://127.0.0.1:27017/example');
mongoose.plugin(require('mongoose-write-stream'));

var Tick = mongoose.model('Tick', {
  time: Number,
  price: Number,
  quantity: Number
});

request('http://api.bitcoincharts.com/v1/csv/bitstampUSD.csv.gz')
  .pipe(zlib.createGunzip())
  .pipe(csv.createStream({
    columns: ['time', 'price', 'quantity']
  }))
  .pipe(Tick.writeStream());

Current Tags

  • 0.0.0                                ...           latest (7 years ago)

1 Versions

  • 0.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |