Files
mongo/jstests/core/write/update/update2.js
Jason Zhang 28eb8d299b SERVER-80780 Merge writes without shard key jscore passthrough with existing passthrough suites (#20175)
GitOrigin-RevId: a54cc3a3df44359ea51533f062642ee841f71460
2024-04-08 02:28:42 +00:00

19 lines
356 B
JavaScript

let f = db.ed_db_update2;
f.drop();
f.save({a: 4});
f.update({a: 4}, {$inc: {a: 2}});
assert.eq(6, f.findOne().a);
f.drop();
f.save({a: 4});
f.createIndex({a: 1});
f.update({a: 4}, {$inc: {a: 2}});
assert.eq(6, f.findOne().a);
// Verify that drop clears the index
f.drop();
f.save({a: 4});
f.update({a: 4}, {$inc: {a: 2}});
assert.eq(6, f.findOne().a);