Files
mongo/jstests/core/query/set/set4.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

18 lines
329 B
JavaScript

let t = db.set4;
t.drop();
let orig = {_id: 1, a: [{x: 1}]};
t.insert(orig);
t.update({}, {$set: {'a.0.x': 2, 'foo.bar': 3}});
orig.a[0].x = 2;
orig.foo = {
bar: 3
};
assert.eq(orig, t.findOne(), "A");
t.update({}, {$set: {'a.0.x': 4, 'foo.bar': 5}});
orig.a[0].x = 4;
orig.foo.bar = 5;
assert.eq(orig, t.findOne(), "B");