Files
mongo/jstests/core/pull_remove1.js
Siyuan Zhou 3660343e0b SERVER-12127 migrate js tests to jscore suite when not related to writes
Migrate js tests starting from j-z.
Include SERVER-12920 Update use_power_of_2.js

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
2014-03-03 22:54:10 -05:00

15 lines
280 B
JavaScript

t = db.pull_remove1
t.drop()
o = { _id : 1 , a : [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] }
t.insert( o )
assert.eq( o , t.findOne() , "A1" )
o.a = o.a.filter( function(z){ return z >= 6; } )
t.update( {} , { $pull : { a : { $lt : 6 } } } )
assert.eq( o.a , t.findOne().a , "A2" )