mongo/jstests/core/query/pull/pull_remove1.js
Zac 591928c619 SERVER-108478 JS formatted by prettier and remove clang-format (#39656)
GitOrigin-RevId: 6c8f6aded47f260aa4f7c231b17dae3302cb1e04
2025-08-21 17:27:09 +00:00

15 lines
262 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");