0.2.8 • Published 9 years ago

co-easymongo v0.2.8

Weekly downloads
8
License
MIT
Repository
github
Last release
9 years ago

co-easymongo

NPM version Build status Dependency status devDependency status

Deprecated in favor of easymongo. Version 5 of easymongo now uses promises which nicely working with co.

Implementation of the easymongo with generator based flow-control.

Currently you must use the --harmony-generators flag when running node 0.12.x to get access to generators.

Installation

$ npm i --save co-easymongo

Examples

var co = require('co');

var mongo = require('co-easymongo')({
  dbname: 'test'
});

co(function *() {
  var posts = mongo.collection('posts');

  // array of documents
  var results = yield posts.find({title: 'Some title'}, {limit: 2});

  // new document
  var result = yield posts.save({title: 'Some title', text: 'Some text'});

  // result of operation (boolean)
  var result = yield posts.remove({title: 'Some title'});
})();

To figure which of APIs are available, you need to read the easymongo readme.

Author

License

The MIT License, see the included license.md file.

0.2.8

9 years ago

0.2.7

10 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago