diff options
author | Dwight <dwight@10gen.com> | 2011-04-06 13:52:02 -0400 |
---|---|---|
committer | Dwight <dwight@10gen.com> | 2011-04-06 13:52:02 -0400 |
commit | 54dc72c6474738d3b1cc05ead0032350518ff29d (patch) | |
tree | 7f3efd9be57cff76f9ffa5294b36c9835691b8d5 /jstests | |
parent | 5c8f497d6c8970e47a45055d9298ebea54a49034 (diff) | |
download | mongo-54dc72c6474738d3b1cc05ead0032350518ff29d.tar.gz |
test compact
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/index_check8.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/jstests/index_check8.js b/jstests/index_check8.js index bc267dfa929..e70a66580bf 100644 --- a/jstests/index_check8.js +++ b/jstests/index_check8.js @@ -4,12 +4,17 @@ t.drop(); t.insert( { a : 1 , b : 1 , c : 1 , d : 1 , e : 1 } ) t.ensureIndex( { a : 1 , b : 1 , c : 1 } ) -t.ensureIndex( { a : 1 , b : 1 , d : 1 , e : 1 } ) +t.ensureIndex({ a: 1, b: 1, d: 1, e: 1 }) + +// this block could be added to many tests in theory... +if ((new Date()) % 10 == 0) { + var coll = t.toString().substring(db.toString().length + 1); + print("compacting " + coll + " before continuing testing"); + assert(db.runCommand({ compact: coll, dev: true }).ok, "compact failed"); +} x = t.find( { a : 1 , b : 1 , d : 1 } ).sort( { e : 1 } ).explain() assert( ! x.scanAndOrder , "A : " + tojson( x ) ) x = t.find( { a : 1 , b : 1 , c : 1 , d : 1 } ).sort( { e : 1 } ).explain() //assert( ! x.scanAndOrder , "B : " + tojson( x ) ) - - |