Files
mongo/jstests/core/query/pull/pull_remove1.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

15 lines
261 B
JavaScript

let t = db.pull_remove1;
t.drop();
let o = {_id: 1, a: [1, 2, 3, 4, 5, 6, 7, 8]};
t.insert(o);
assert.eq(o, t.findOne(), "A1");
o.a = o.a.filter(function(z) {
return z >= 6;
});
t.update({}, {$pull: {a: {$lt: 6}}});
assert.eq(o.a, t.findOne().a, "A2");