summaryrefslogtreecommitdiff
path: root/jstests/core/covered_index_simple_1.js
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2014-10-07 18:23:21 -0400
committerDavid Storch <david.storch@10gen.com>2014-10-13 19:59:21 -0400
commitd601b91b6b16be3f93bac2f10952c1e5d273f91f (patch)
treef8b7daf9d3920ded5567489d0d65df50afed9542 /jstests/core/covered_index_simple_1.js
parente7a49e50e5a858b02c9c242c943d7559238bb2b6 (diff)
downloadmongo-d601b91b6b16be3f93bac2f10952c1e5d273f91f.tar.gz
SERVER-14875 explain helpers for the shell
Diffstat (limited to 'jstests/core/covered_index_simple_1.js')
-rw-r--r--jstests/core/covered_index_simple_1.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/jstests/core/covered_index_simple_1.js b/jstests/core/covered_index_simple_1.js
index 146f0751f1c..3edde455754 100644
--- a/jstests/core/covered_index_simple_1.js
+++ b/jstests/core/covered_index_simple_1.js
@@ -20,49 +20,49 @@ coll.insert({foo:null})
coll.ensureIndex({foo:1})
// Test equality with int value
-var plan = coll.find({foo:1}, {foo:1, _id:0}).hint({foo:1}).explain()
+var plan = coll.find({foo:1}, {foo:1, _id:0}).hint({foo:1}).explain("executionStats");
assert(isIndexOnly(plan.queryPlanner.winningPlan),
"simple.1.1 - indexOnly should be true on covered query")
assert.eq(0, plan.executionStats.totalDocsExamined,
"simple.1.1 - docs examined should be 0 for covered query")
// Test equality with string value
-var plan = coll.find({foo:"string"}, {foo:1, _id:0}).hint({foo:1}).explain()
+var plan = coll.find({foo:"string"}, {foo:1, _id:0}).hint({foo:1}).explain("executionStats");
assert(isIndexOnly(plan.queryPlanner.winningPlan),
"simple.1.2 - indexOnly should be true on covered query")
assert.eq(0, plan.executionStats.totalDocsExamined,
"simple.1.2 - docs examined should be 0 for covered query")
// Test equality with doc value
-var plan = coll.find({foo:{bar:1}}, {foo:1, _id:0}).hint({foo:1}).explain()
+var plan = coll.find({foo:{bar:1}}, {foo:1, _id:0}).hint({foo:1}).explain("executionStats");
assert(isIndexOnly(plan.queryPlanner.winningPlan),
"simple.1.3 - indexOnly should be true on covered query")
assert.eq(0, plan.executionStats.totalDocsExamined,
"simple.1.3 - docs examined should be 0 for covered query")
// Test no query
-var plan = coll.find({}, {foo:1, _id:0}).hint({foo:1}).explain()
+var plan = coll.find({}, {foo:1, _id:0}).hint({foo:1}).explain("executionStats");
assert(isIndexOnly(plan.queryPlanner.winningPlan),
"simple.1.4 - indexOnly should be true on covered query")
assert.eq(0, plan.executionStats.totalDocsExamined,
"simple.1.4 - docs examined should be 0 for covered query")
// Test range query
-var plan = coll.find({foo:{$gt:2,$lt:6}}, {foo:1, _id:0}).hint({foo:1}).explain()
+var plan = coll.find({foo:{$gt:2,$lt:6}}, {foo:1, _id:0}).hint({foo:1}).explain("executionStats");
assert(isIndexOnly(plan.queryPlanner.winningPlan),
"simple.1.5 - indexOnly should be true on covered query")
assert.eq(0, plan.executionStats.totalDocsExamined,
"simple.1.5 - docs examined should be 0 for covered query")
// Test in query
-var plan = coll.find({foo:{$in:[5,8]}}, {foo:1, _id:0}).hint({foo:1}).explain()
+var plan = coll.find({foo:{$in:[5,8]}}, {foo:1, _id:0}).hint({foo:1}).explain("executionStats");
assert(isIndexOnly(plan.queryPlanner.winningPlan),
"simple.1.6 - indexOnly should be true on covered query")
assert.eq(0, plan.executionStats.totalDocsExamined,
"simple.1.6 - docs examined should be 0 for covered query")
// Test no return
-var plan = coll.find({foo:"2"}, {foo:1, _id:0}).hint({foo:1}).explain()
+var plan = coll.find({foo:"2"}, {foo:1, _id:0}).hint({foo:1}).explain("executionStats");
assert(isIndexOnly(plan.queryPlanner.winningPlan),
"simple.1.7 - indexOnly should be true on covered query")
assert.eq(0, plan.executionStats.totalDocsExamined,