Implementation of the easymongo with generator based flow-control.
Currently you must use the
--harmony-generators flag when running node 0.11.x to get access to generators.
$ npm install co-easymongo
var co = require'co';var mongo = require'co-easymongo'dbname: 'test';covar posts = mongocollection'posts';// array of documentsvar results = yield postsfindtitle: 'Some title' limit: 2;// new documentvar result = yield postssavetitle: 'Some title' text: 'Some text';// result of operation (boolean)var result = yield postsremovetitle: 'Some title';;
To figure which of APIs are available, you need to read the easymongo readme.
The MIT License, see the included