Files
mongo/jstests/core/write/autoid.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

12 lines
275 B
JavaScript

let f = db.jstests_autoid;
f.drop();
f.save({z: 1});
let a = f.findOne({z: 1});
f.update({z: 1}, {z: 2});
let b = f.findOne({z: 2});
assert.eq(a._id.str, b._id.str);
let c = f.update({z: 2}, {z: "abcdefgabcdefgabcdefg"});
c = f.findOne({});
assert.eq(a._id.str, c._id.str);