diff options
Diffstat (limited to 'jstests/core/remove6.js')
-rw-r--r-- | jstests/core/remove6.js | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/jstests/core/remove6.js b/jstests/core/remove6.js index 83f5a5e6733..61cc39b6e3e 100644 --- a/jstests/core/remove6.js +++ b/jstests/core/remove6.js @@ -4,37 +4,36 @@ t.drop(); N = 1000; -function pop(){ +function pop() { t.drop(); var arr = []; - for ( var i=0; i<N; i++ ){ - arr.push( { x : 1 , tags : [ "a" , "b" , "c" ] } ); + for (var i = 0; i < N; i++) { + arr.push({x: 1, tags: ["a", "b", "c"]}); } - t.insert( arr ); - assert.eq( t.count(), N ); + t.insert(arr); + assert.eq(t.count(), N); } -function del(){ - return t.remove( { tags : { $in : [ "a" , "c" ] } } ); +function del() { + return t.remove({tags: {$in: ["a", "c"]}}); } -function test( n , idx ){ +function test(n, idx) { pop(); - assert.eq( N , t.count() , n + " A " + idx ); - if ( idx ) - t.ensureIndex( idx ); + assert.eq(N, t.count(), n + " A " + idx); + if (idx) + t.ensureIndex(idx); var res = del(); - assert( !res.hasWriteError() , "error deleting: " + res.toString() ); - assert.eq( 0 , t.count() , n + " B " + idx ); + assert(!res.hasWriteError(), "error deleting: " + res.toString()); + assert.eq(0, t.count(), n + " B " + idx); } -test( "a" ); -test( "b" , { x : 1 } ); -test( "c" , { tags : 1 } ); +test("a"); +test("b", {x: 1}); +test("c", {tags: 1}); N = 5000; -test( "a2" ); -test( "b2" , { x : 1 } ); -test( "c2" , { tags : 1 } ); - +test("a2"); +test("b2", {x: 1}); +test("c2", {tags: 1}); |