summaryrefslogtreecommitdiff
path: root/jstests/index_arr1.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-05-04 19:18:59 -0400
committerEliot Horowitz <eliot@10gen.com>2010-05-04 19:18:59 -0400
commit5d4d3c74f1b9e33fc5b0c6d8d3910eab572a7bfe (patch)
tree8486b97f83c25ecd8813edfc54c579271c934b3c /jstests/index_arr1.js
parent4b81c59f016a96de9feebc36c5159a7a99999cdb (diff)
downloadmongo-5d4d3c74f1b9e33fc5b0c6d8d3910eab572a7bfe.tar.gz
another case for SERVER-1082
Diffstat (limited to 'jstests/index_arr1.js')
-rw-r--r--jstests/index_arr1.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/jstests/index_arr1.js b/jstests/index_arr1.js
index 0ac3a2528f0..d35cb80a83f 100644
--- a/jstests/index_arr1.js
+++ b/jstests/index_arr1.js
@@ -6,11 +6,18 @@ t.insert( { _id : 1 , a : 5 , b : [ { x : 1 } ] } )
t.insert( { _id : 2 , a : 5 , b : [] } )
t.insert( { _id : 3 , a : 5 } )
-assert.eq( 3 , t.find( { a : 5 } ).itcount() , "A" )
+assert.eq( 3 , t.find( { a : 5 } ).itcount() , "A1" )
t.ensureIndex( { a : 1 , "b.x" : 1 } )
//t.find().sort( { a : 1 } )._addSpecial( "$returnKey" , 1 ).forEach( printjson )
//t.find( { a : 5 } ).forEach( printjson )
-assert.eq( 3 , t.find( { a : 5 } ).itcount() , "B" ); // SERVER-1082
+assert.eq( 3 , t.find( { a : 5 } ).itcount() , "A2" ); // SERVER-1082
+
+
+assert.eq( 2 , t.getIndexes().length , "B1" )
+t.insert( { _id : 4 , a : 5 , b : [] } )
+t.ensureIndex( { a : 1 , "b.a" : 1 , "b.c" : 1 } )
+assert.eq( 3 , t.getIndexes().length , "B2" )
+