Blame view

node_modules/mongojs/test/test-cursor-foreach.js 361 Bytes
46de8790   Tarpit Grover   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var insert = require('./insert');

var pokemons = [{
  name:'Squirtle', type:'water'
}, {
  name:'Starmie' , type:'water'
}, {
  name:'Lapras'  , type:'water'
}];

insert('remove', pokemons, function(db, t, done) {
  var i = 0;
  db.a.find().forEach(function(err, pkm) {
    if (++i === 4) return t.end();
    t.equal(pkm.name, pokemons[i - 1].name);
  });
});