diff options
author | David Storch <david.storch@10gen.com> | 2014-08-27 15:36:08 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2014-09-03 09:46:33 -0400 |
commit | 391b1121e36fd85d7e85c4442dccf8367e6da770 (patch) | |
tree | 0cf17a810a3c242b2c2a6363f9f18589fedc2fb6 /jstests/core/explain1.js | |
parent | 6bf17f12e3fde9bee14d2bb9c90001080546f867 (diff) | |
download | mongo-391b1121e36fd85d7e85c4442dccf8367e6da770.tar.gz |
SERVER-14742 delete old explain and turn on explain 2.0
Diffstat (limited to 'jstests/core/explain1.js')
-rw-r--r-- | jstests/core/explain1.js | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/jstests/core/explain1.js b/jstests/core/explain1.js index e497bbfb9a9..59d29100507 100644 --- a/jstests/core/explain1.js +++ b/jstests/core/explain1.js @@ -18,31 +18,7 @@ assert.eq( 49 , t.find( q ).count() , "D" ); assert.eq( 49 , t.find( q ).itcount() , "E" ); assert.eq( 20 , t.find( q ).limit(20).itcount() , "F" ); -assert.eq( 49 , t.find(q).explain().n , "G" ); -assert.eq( 20 , t.find(q).limit(20).explain().n , "H" ); -assert.eq( 20 , t.find(q).limit(-20).explain().n , "I" ); -assert.eq( 49 , t.find(q).batchSize(20).explain().n , "J" ); - -// verbose explain output with stats -// display index bounds - -var explainGt = t.find({x: {$gt: 5}}).explain(true); -var boundsVerboseGt = explainGt.stats.inputStage.indexBounds; - -print('explain stats for $gt = ' + tojson(explainGt.stats)); - -var explainGte = t.find({x: {$gte: 5}}).explain(true); -var boundsVerboseGte = explainGte.stats.inputStage.indexBounds; - -print('explain stats for $gte = ' + tojson(explainGte.stats)); - -print('index bounds for $gt = ' + tojson(explainGt.indexBounds)); -print('index bounds for $gte = ' + tojson(explainGte.indexBounds)); - -print('verbose bounds for $gt = ' + tojson(boundsVerboseGt)); -print('verbose bounds for $gte = ' + tojson(boundsVerboseGte)); - -// Since the verbose bounds are opaque, all we try to confirm is that the -// verbose bounds for $gt is different from those generated for $gte. -assert.neq(boundsVerboseGt, boundsVerboseGte, - 'verbose bounds for $gt and $gte should not be the same'); +assert.eq( 49 , t.find(q).explain().executionStats.nReturned , "G" ); +assert.eq( 20 , t.find(q).limit(20).explain().executionStats.nReturned , "H" ); +assert.eq( 20 , t.find(q).limit(-20).explain().executionStats.nReturned , "I" ); +assert.eq( 49 , t.find(q).batchSize(20).explain().executionStats.nReturned , "J" ); |