No bullshit mongo wrapper
JavaScript
Latest commit 4390fdb Apr 10, 2013 @Raynos 0.2.1
Failed to load latest commit information.
examples do not use method ~_~ Mar 5, 2013
test
.gitignore
.testem.json
.travis.yml
LICENCE
README.md updated example Jan 6, 2013
close.js
cursor.js
find.js
findAndModify.js
findAndRemove.js
findOne.js first version Jan 5, 2013
index.js
insert.js
mapReduce.js first version Jan 6, 2013
package.json
remove.js
update.js first version Jan 6, 2013

README.md

mongo-client

build status

No bullshit mongo wrapper

Similar to mongodb or mongo-col except everything is a function that operates on a collection and returns a reducible representation of the result.

Example

var uuid = require("node-uuid")
var assert = require("assert")
var fold = require("reducers/fold")
var expand = require("reducers/expand")

var mongo = require("mongo-client")
var insert = require("mongo-client/insert")
var findOne = require("mongo-client/findOne")
var close = require("mongo-client/close")

var client = mongo("mongodb://localhost:27017/mongo-client-example")
var collectionName = uuid()
var collection = client(collectionName)

var insertResult = insert(collection, {
    hello: "world"
})

var findResult = expand(insertResult, function (item) {
    assert.equal(item.hello, "world")
    return findOne(collection, {
        _id: item._id
    })
})

fold(findResult, function (value) {
    assert.equal(value.hello, "world")
    console.log("value", value)
    close(collection)
})

Commands

Supports

  • update
  • insert
  • remove
  • findAndModify
  • findAndRemove
  • findOne
  • find
  • mapReduce

Installation

npm install mongo-client

Contributors

  • Raynos

MIT Licenced