summaryrefslogtreecommitdiff
path: root/jstests/core/or_always_false.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/or_always_false.js')
-rw-r--r--jstests/core/or_always_false.js21
1 files changed, 10 insertions, 11 deletions
diff --git a/jstests/core/or_always_false.js b/jstests/core/or_always_false.js
index eb479486eac..6760ee37775 100644
--- a/jstests/core/or_always_false.js
+++ b/jstests/core/or_always_false.js
@@ -1,17 +1,16 @@
// Tests that a rooted-$or query with each clause provably false will not return any results.
(function() {
- "use strict";
+"use strict";
- const coll = db.or_always_false;
- coll.drop();
+const coll = db.or_always_false;
+coll.drop();
- assert.writeOK(coll.insert([{}, {}, {}]));
- const emptyOrError = assert.throws(() => coll.find({$or: []}).itcount());
- assert.eq(emptyOrError.code, ErrorCodes.BadValue);
+assert.writeOK(coll.insert([{}, {}, {}]));
+const emptyOrError = assert.throws(() => coll.find({$or: []}).itcount());
+assert.eq(emptyOrError.code, ErrorCodes.BadValue);
- assert.eq(coll.find({$or: [{$alwaysFalse: 1}]}).itcount(), 0);
- assert.eq(coll.find({$or: [{a: {$all: []}}]}).itcount(), 0);
- assert.eq(coll.find({$or: [{$alwaysFalse: 1}, {$alwaysFalse: 1}]}).itcount(), 0);
- assert.eq(coll.find({$or: [{$alwaysFalse: 1}, {a: {$all: []}}, {$alwaysFalse: 1}]}).itcount(),
- 0);
+assert.eq(coll.find({$or: [{$alwaysFalse: 1}]}).itcount(), 0);
+assert.eq(coll.find({$or: [{a: {$all: []}}]}).itcount(), 0);
+assert.eq(coll.find({$or: [{$alwaysFalse: 1}, {$alwaysFalse: 1}]}).itcount(), 0);
+assert.eq(coll.find({$or: [{$alwaysFalse: 1}, {a: {$all: []}}, {$alwaysFalse: 1}]}).itcount(), 0);
}());