diff options
author | Antonin Kral <a.kral@bobek.cz> | 2010-03-25 19:21:32 +0100 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2010-03-25 19:21:32 +0100 |
commit | 0ca01a91ae0a3562e54c226e7b9512feb2ea83d0 (patch) | |
tree | 2b3886e435b0217d6afd63a213b04d32bb4b4f6f /jstests/index8.js | |
parent | a696359b248adef0cc8576fce3f473535e995136 (diff) | |
download | mongodb-0ca01a91ae0a3562e54c226e7b9512feb2ea83d0.tar.gz |
Imported Upstream version 1.4.0
Diffstat (limited to 'jstests/index8.js')
-rw-r--r-- | jstests/index8.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/jstests/index8.js b/jstests/index8.js index 09a0645..719ad2d 100644 --- a/jstests/index8.js +++ b/jstests/index8.js @@ -9,11 +9,14 @@ t.ensureIndex( { c: 1 }, [ false, "cIndex" ] ); checkIndexes = function( num ) { // printjson( db.system.indexes.find( { ns: "test.jstests_index8" } ).toArray() ); - indexes = db.system.indexes.find( { ns: "test.jstests_index8" } ).sort( { key: 1 } ); - assert( !indexes[ 0 ].unique , "A" + num ); - assert( indexes[ 1 ].unique , "B" + num ); - assert( !indexes[ 2 ].unique , "C" + num ); - assert.eq( "cIndex", indexes[ 2 ].name , "D" + num ); + indexes = db.system.indexes.find( { ns: "test.jstests_index8" } ).sort( { key: 1 } ).toArray(); + var start = 0; + if ( indexes[0].name == "_id_" ) + start = 1; + assert( !indexes[ start ].unique , "A" + num ); + assert( indexes[ start + 1 ].unique , "B" + num + " " + tojson( indexes[start+1] ) ); + assert( !indexes[ start + 2 ].unique , "C" + num ); + assert.eq( "cIndex", indexes[ start + 2 ].name , "D" + num ); } checkIndexes( 1 ); |