summaryrefslogtreecommitdiff
path: root/jstests/core/server50762.js
blob: 4f01e54bb8d5d1210cb1f7bde8329b24b1f498e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Tests the behavior of $size for match expressions.

(function() {
"use strict";

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());
}());