mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-29 00:32:18 +01:00
28eb8d299b
GitOrigin-RevId: a54cc3a3df44359ea51533f062642ee841f71460
12 lines
275 B
JavaScript
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);
|