summaryrefslogtreecommitdiff
path: root/jstests/core/explain5.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/explain5.js
parente7a49e50e5a858b02c9c242c943d7559238bb2b6 (diff)
downloadmongo-d601b91b6b16be3f93bac2f10952c1e5d273f91f.tar.gz
SERVER-14875 explain helpers for the shell
Diffstat (limited to 'jstests/core/explain5.js')
-rw-r--r--jstests/core/explain5.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/jstests/core/explain5.js b/jstests/core/explain5.js
index 22f8ae9f184..eb8e5d9f4a2 100644
--- a/jstests/core/explain5.js
+++ b/jstests/core/explain5.js
@@ -11,7 +11,9 @@ for( i = 0; i < 1000; ++i ) {
}
// Query with an initial set of documents.
-var explain1 = t.find( { a:{ $gte:0 }, b:2 } ).sort( { a:1 } ).hint( { a:1 } ).explain();
+var explain1 = t.find( { a:{ $gte:0 }, b:2 } ).sort( { a:1 } )
+ .hint( { a:1 } )
+ .explain("executionStats");
printjson(explain1);
var stats1 = explain1.executionStats;
assert.eq( 333, stats1.nReturned, 'wrong nReturned for explain1' );
@@ -22,7 +24,9 @@ for( i = 1000; i < 2000; ++i ) {
}
// Query with some additional documents.
-var explain2 = t.find( { a:{ $gte:0 }, b:2 } ).sort( { a:1 } ).hint ( { a:1 } ).explain();
+var explain2 = t.find( { a:{ $gte:0 }, b:2 } ).sort( { a:1 } )
+ .hint ( { a:1 } )
+ .explain("executionStats");
printjson(explain2);
var stats2 = explain2.executionStats;
assert.eq( 666, stats2.nReturned, 'wrong nReturned for explain2' );