summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorMelodee Li <melodeeli98@gmail.com>2020-11-06 21:27:49 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-12 20:17:24 +0000
commitac9d73de226e40aaa16f5e8c4c44536d49631e49 (patch)
tree6e1ccba15852779f2e5e75ad39c9fb2dda332b7d /jstests
parent00759b253d58a3cea5a316b9dbfce43d9eaebf20 (diff)
downloadmongo-ac9d73de226e40aaa16f5e8c4c44536d49631e49.tar.gz
SERVER-50762 [SBE] SizeMatchExpression can produce wrong results in some cases involving nesting
Diffstat (limited to 'jstests')
-rw-r--r--jstests/core/find_size.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/jstests/core/find_size.js b/jstests/core/find_size.js
index 14949f0f477..9b0864be4c7 100644
--- a/jstests/core/find_size.js
+++ b/jstests/core/find_size.js
@@ -1,5 +1,4 @@
// Tests the behavior of $size for match expressions.
-
(function() {
"use strict";
@@ -84,4 +83,10 @@ badInputs.forEach(function(input) {
assert.commandFailed(db.runCommand({find: coll.getName(), filter: {"a": {$size: input}}}),
"$size argument " + input + " should have failed");
});
+
+assert(coll.drop());
+
+// Check nested arrays.
+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());
}());