Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Streaming interface to mongo
JavaScript
branch: master

first

latest commit fcd3ba970c
@Raynos authored
Failed to load latest commit information.
examples first
.gitignore first
LICENCE first
Makefile first
README.md first
index.js first
package.json first

README.md

mongo-stream

Streaming interface to mongo

Example

var collection = require("mongo-col")
    , from = require("read-stream").fromArray
    , to = require("write-stream").toArray
    , MongoStream = require("mongo-stream")

    , someCollection = collection("name")
    , someCollectionStream = MongoStream(someCollection)
    , data = [{
        some: "data"
    }]

from(data)
    .pipe(someCollectionStream.insert({ safe: true }))
    .pipe(to([], function readList(list) {
        console.log("inserted correctly", list)

        someCollectionStream.find({ hello: "world" })
            .pipe(to([], function readResult(list2) {
                console.log("found correctly", list2)
            }))
    }))

Installation

npm install mongo-stream

Contributors

  • Raynos

MIT Licenced

Something went wrong with that request. Please try again.