Blame view

node_modules/mongojs/test/test-update-and-callback.js 379 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('update and callback', [{
  hello:'world'
}], function(db, t, done) {
  var sync = true;
  db.a.update({hello:'world'}, {$set:{hello:'verden'}}, function(err, lastErrorObject) {
    t.ok(!sync);
    t.ok(!err);
    t.equal(lastErrorObject.updatedExisting, true);
    t.equal(lastErrorObject.n, 1);

    done();
  });
  sync = false;
});