summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod/projection_optimizations.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthroughWithMongod/projection_optimizations.js')
-rw-r--r--jstests/noPassthroughWithMongod/projection_optimizations.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/jstests/noPassthroughWithMongod/projection_optimizations.js b/jstests/noPassthroughWithMongod/projection_optimizations.js
index 8658d6f2260..2b9418cdd6e 100644
--- a/jstests/noPassthroughWithMongod/projection_optimizations.js
+++ b/jstests/noPassthroughWithMongod/projection_optimizations.js
@@ -25,7 +25,8 @@ let result = runFindWithProjection({
expected: [{a: 1, b: false}]
});
// Query should be optimized and covered.
-assert(isIndexOnly(db, getWinningPlan(result.explain().queryPlanner)));
+const winningPlan = getWinningPlan(result.explain().queryPlanner);
+assert(isIndexOnly(db, winningPlan), winningPlan);
result = runFindWithProjection(
{projection: {a: {$and: ['$a', true, 1]}}, expected: [{_id: 0, a: true}]});