Blame view

node_modules/mongojs/test/test-cursor-map.js 312 Bytes
46de8790   Tarpit Grover   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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.equal(res[0], 'world1');
    t.equal(res[1], 'world2');
    done();
  });
});