summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
Diffstat (limited to 'jstests')
-rw-r--r--jstests/core/expr.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/jstests/core/expr.js b/jstests/core/expr.js
index 362e06c9a55..c599bcd757e 100644
--- a/jstests/core/expr.js
+++ b/jstests/core/expr.js
@@ -24,8 +24,9 @@ const isMongos = (hello.msg === "isdbgrid");
//
coll.drop();
-assert.commandWorked(coll.insert({a: 0}));
+assert.commandWorked(coll.insert({_id: 0, a: 0}));
assert.eq(1, coll.aggregate([{$match: {$expr: {$eq: ["$a", 0]}}}]).itcount());
+assert.eq(1, coll.aggregate([{$match: {$expr: {$eq: ["$$ROOT", {_id: 0, a: 0}]}}}]).itcount());
assert.throws(function() {
coll.aggregate([{$match: {$expr: {$eq: ["$a", "$$unbound"]}}}]);
});