Files
mongo/jstests/core/query/server50762.js
2024-12-27 12:42:24 +00:00

11 lines
349 B
JavaScript

// Tests the behavior of $size for match expressions.
// @tags: [
// requires_getmore,
// ]
const coll = db.server50762;
coll.drop();
// Test $size when it's nested inside $and/$or.
assert.commandWorked(coll.insert([{a: 1, b: "foo"}, {a: 1, b: [7, 8, 9]}]));
assert.eq(1, coll.find({$or: [{$and: [{b: {$size: 3}}, {a: 1}]}, {a: 0}]}).itcount());