diff options
Diffstat (limited to 'jstests/core/pullall2.js')
-rw-r--r-- | jstests/core/pullall2.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/jstests/core/pullall2.js b/jstests/core/pullall2.js index 61369badaa4..c97c4e43aba 100644 --- a/jstests/core/pullall2.js +++ b/jstests/core/pullall2.js @@ -1,20 +1,20 @@ -t = db.pullall2 -t.drop() +t = db.pullall2; +t.drop(); -o = { _id : 1 , a : [] } +o = { _id : 1 , a : [] }; for ( i=0; i<5; i++ ) - o.a.push( { x : i , y : i } ) + o.a.push( { x : i , y : i } ); -t.insert( o ) +t.insert( o ); assert.eq( o , t.findOne() , "A" ); -t.update( {} , { $pull : { a : { x : 3 } } } ) -o.a = o.a.filter( function(z){ return z.x != 3 } ) +t.update( {} , { $pull : { a : { x : 3 } } } ); +o.a = o.a.filter( function(z){ return z.x != 3; } ); assert.eq( o , t.findOne() , "B" ); t.update( {} , { $pull : { a : { x : { $in : [ 1 , 4 ] } } } } ); -o.a = o.a.filter( function(z){ return z.x != 1 } ) -o.a = o.a.filter( function(z){ return z.x != 4 } ) +o.a = o.a.filter( function(z){ return z.x != 1; } ); +o.a = o.a.filter( function(z){ return z.x != 4; } ); assert.eq( o , t.findOne() , "C" ); |