diff options
author | Randolph Tan <randolph@10gen.com> | 2014-01-14 14:09:42 -0500 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2014-02-28 16:26:33 -0500 |
commit | 5595b945603b0712c537787e31e6da661c424fee (patch) | |
tree | 90945ee3fe4931032f3af2d397bb755fbf5d30ef /jstests/distinct_index2.js | |
parent | cd62080dcb036e83f8fca6d68d9bcab67bf7a21c (diff) | |
download | mongo-5595b945603b0712c537787e31e6da661c424fee.tar.gz |
SERVER-12127 migrate js tests to jscore suite when not related to writes
Moved test jstest/[a-i].js -> jstests/core/ and made changes to comply with write command api
Diffstat (limited to 'jstests/distinct_index2.js')
-rw-r--r-- | jstests/distinct_index2.js | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/jstests/distinct_index2.js b/jstests/distinct_index2.js deleted file mode 100644 index 67d28b8b95e..00000000000 --- a/jstests/distinct_index2.js +++ /dev/null @@ -1,41 +0,0 @@ -t = db.distinct_index2; -t.drop(); - -t.ensureIndex( { a : 1 , b : 1 } ) -t.ensureIndex( { c : 1 } ) - -// Uniformly distributed dataset. -// If we use a randomly generated dataset, we might not -// generate all the distinct values in the range [0, 10). -for ( var a=0; a<10; a++ ) { - for ( var b=0; b<10; b++ ) { - for ( var c=0; c<10; c++ ) { - t.insert( { a : a , b : b , c : c } ); - } - } -} - -correct = [] -for ( i=0; i<10; i++ ) - correct.push( i ) - -function check( field ){ - res = t.distinct( field ) - res = res.sort() - assert.eq( correct , res , "check: " + field ); - - if ( field != "a" ){ - res = t.distinct( field , { a : 1 } ) - res = res.sort() - assert.eq( correct , res , "check 2: " + field ); - } -} - -check( "a" ) -check( "b" ) -check( "c" ) - -// hashed index should produce same results. -t.dropIndexes(); -t.ensureIndex( { a : "hashed" } ); -check( "a" ); |