2009-01-27 14:18:33 -05:00
|
|
|
f = db.ed_db_update2;
|
|
|
|
|
|
2009-01-27 16:16:53 -05:00
|
|
|
f.drop();
|
2016-03-09 12:17:50 -05:00
|
|
|
f.save({a: 4});
|
|
|
|
|
f.update({a: 4}, {$inc: {a: 2}});
|
|
|
|
|
assert.eq(6, f.findOne().a);
|
2009-01-27 14:18:33 -05:00
|
|
|
|
|
|
|
|
f.drop();
|
2016-03-09 12:17:50 -05:00
|
|
|
f.save({a: 4});
|
|
|
|
|
f.ensureIndex({a: 1});
|
|
|
|
|
f.update({a: 4}, {$inc: {a: 2}});
|
|
|
|
|
assert.eq(6, f.findOne().a);
|
2009-01-28 09:58:54 -05:00
|
|
|
|
|
|
|
|
// Verify that drop clears the index
|
|
|
|
|
f.drop();
|
2016-03-09 12:17:50 -05:00
|
|
|
f.save({a: 4});
|
|
|
|
|
f.update({a: 4}, {$inc: {a: 2}});
|
|
|
|
|
assert.eq(6, f.findOne().a);
|