0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/pull_remove1.js

15 lines
280 B
JavaScript
Raw Normal View History

2010-08-28 18:31:26 +02:00
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" )
2010-08-28 18:31:26 +02:00