diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-12-07 15:03:18 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-12-07 15:03:18 -0500 |
commit | 85c3e9551c132e9b7c2de6ee9da50b3a76c6ea2b (patch) | |
tree | 00b33a575f309c8d12c454ab1e9c764d9c86cee2 /jstests | |
parent | 9045c292fcd2c70df08b4210a7a82a48fe0422f8 (diff) | |
parent | eafca06a884d075dc673d7d8b84dbc60ce312148 (diff) | |
download | mongo-v1.0.tar.gz |
Merge branch 'v1.0' of git@github.com:mongodb/mongo into v1.0v1.0
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/indexapi.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/jstests/indexapi.js b/jstests/indexapi.js index ae76ec74f57..2532656580f 100644 --- a/jstests/indexapi.js +++ b/jstests/indexapi.js @@ -4,37 +4,5 @@ t.drop(); key = { x : 1 }; -c = { ns : t._fullName , key : key , name : t._genIndexName( key ) }; -assert.eq( c , t._indexSpec( { x : 1 } ) , "A" ); - -c.name = "bob"; -assert.eq( c , t._indexSpec( { x : 1 } , "bob" ) , "B" ); - -c.name = t._genIndexName( key ); -assert.eq( c , t._indexSpec( { x : 1 } ) , "C" ); - -c.unique = true; -assert.eq( c , t._indexSpec( { x : 1 } , true ) , "D" ); -assert.eq( c , t._indexSpec( { x : 1 } , [ true ] ) , "E" ); -assert.eq( c , t._indexSpec( { x : 1 } , { unique : true } ) , "F" ); - -c.dropDups = true; -assert.eq( c , t._indexSpec( { x : 1 } , [ true , true ] ) , "G" ); -assert.eq( c , t._indexSpec( { x : 1 } , { unique : true , dropDups : true } ) , "F" ); - -t.ensureIndex( { x : 1 } , { unique : true } ); -idx = t.getIndexes(); -assert.eq( 2 , idx.length , "M1" ); -assert.eq( key , idx[1].key , "M2" ); -assert( idx[1].unique , "M3" ); - -t.drop(); -t.ensureIndex( { x : 1 } , { unique : 1 } ); -idx = t.getIndexes(); -assert.eq( 2 , idx.length , "M1" ); -assert.eq( key , idx[1].key , "M2" ); -assert( idx[1].unique , "M3" ); -printjson( idx ); - db.system.indexes.insert( { ns : "test" , key : { x : 1 } , name : "x" } ); assert( db.getLastError().indexOf( "invalid" ) >= 0 , "Z1" ); |