diff options
Diffstat (limited to 'jstests/remove8.js')
-rw-r--r-- | jstests/remove8.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/jstests/remove8.js b/jstests/remove8.js new file mode 100644 index 00000000000..3ab53f3289a --- /dev/null +++ b/jstests/remove8.js @@ -0,0 +1,21 @@ + +t = db.remove8; +t.drop(); + +N = 1000; + +function fill(){ + for ( var i=0; i<N; i++ ){ + t.save( { x : i } ); + } +} + +fill(); +assert.eq( N , t.count() , "A" ); +t.remove( {} ) +assert.eq( 0 , t.count() , "B" ); + +fill(); +assert.eq( N , t.count() , "C" ); +db.eval( function(){ db.remove8.remove( {} ); } ) +assert.eq( 0 , t.count() , "D" ); |