Files
mongo/jstests/core/query/pull/pull_remove1.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
262 B
JavaScript
Raw Normal View History

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