summaryrefslogtreecommitdiff
path: root/jstests/core/find_size.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/find_size.js')
-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());
}());