diff options
Diffstat (limited to 'jstests/core/indexe.js')
-rw-r--r-- | jstests/core/indexe.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/jstests/core/indexe.js b/jstests/core/indexe.js new file mode 100644 index 00000000000..e84322c6510 --- /dev/null +++ b/jstests/core/indexe.js @@ -0,0 +1,22 @@ + +t = db.indexe; +t.drop(); + +var num = 1000; + +for ( i=0; i<num; i++){ + t.insert( { a : "b" } ); +} + +assert.eq( num , t.find().count() ,"A1" ); +assert.eq( num , t.find( { a : "b" } ).count() , "B1" ); +assert.eq( num , t.find( { a : "b" } ).itcount() , "C1" ); + +t.ensureIndex( { a : 1 } ); + +assert.eq( num , t.find().count() ,"A2" ); +assert.eq( num , t.find().sort( { a : 1 } ).count() , "A2a" ); +assert.eq( num , t.find( { a : "b" } ).count() , "B2" ); +assert.eq( num , t.find( { a : "b" } ).itcount() , "C3" ); + +t.drop(); |