diff options
Diffstat (limited to 'jstests/core/optimized_match_explain.js')
-rw-r--r-- | jstests/core/optimized_match_explain.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/jstests/core/optimized_match_explain.js b/jstests/core/optimized_match_explain.js index 6f73349e08c..5575b8498bb 100644 --- a/jstests/core/optimized_match_explain.js +++ b/jstests/core/optimized_match_explain.js @@ -4,22 +4,22 @@ * Tests that the explain output for $match reflects any optimizations. */ (function() { - "use strict"; - load("jstests/libs/analyze_plan.js"); +"use strict"; +load("jstests/libs/analyze_plan.js"); - const coll = db.match_explain; - coll.drop(); +const coll = db.match_explain; +coll.drop(); - assert.writeOK(coll.insert({a: 1, b: 1})); - assert.writeOK(coll.insert({a: 2, b: 3})); - assert.writeOK(coll.insert({a: 1, b: 2})); - assert.writeOK(coll.insert({a: 1, b: 4})); +assert.writeOK(coll.insert({a: 1, b: 1})); +assert.writeOK(coll.insert({a: 2, b: 3})); +assert.writeOK(coll.insert({a: 1, b: 2})); +assert.writeOK(coll.insert({a: 1, b: 4})); - // Explain output should reflect optimizations. - // $and should not be in the explain output because it is optimized out. - let explain = coll.explain().aggregate( - [{$sort: {b: -1}}, {$addFields: {c: {$mod: ["$a", 4]}}}, {$match: {$and: [{c: 1}]}}]); +// Explain output should reflect optimizations. +// $and should not be in the explain output because it is optimized out. +let explain = coll.explain().aggregate( + [{$sort: {b: -1}}, {$addFields: {c: {$mod: ["$a", 4]}}}, {$match: {$and: [{c: 1}]}}]); - assert.commandWorked(explain); - assert.eq(getAggPlanStage(explain, "$match"), {$match: {c: {$eq: 1}}}); +assert.commandWorked(explain); +assert.eq(getAggPlanStage(explain, "$match"), {$match: {c: {$eq: 1}}}); }()); |