mongojs
Version:
Easy to use module that implements the mongo api
18 lines (16 loc) • 325 B
JavaScript
var insert = require('./insert')
insert('cursor.map', [{
hello: 'world1'
}, {
hello: 'world2'
}], function (db, t, done) {
var cursor = db.a.find()
cursor.map(function (x) {
return x.hello
}, function (err, res) {
t.error(err)
t.equal(res[0], 'world1')
t.equal(res[1], 'world2')
done()
})
})