0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-25 00:58:53 +01:00
mongodb/jstests/core/write/autoid.js
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);