Files
mongo/jstests/core/update_multi5.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

18 lines
279 B
JavaScript

t = db.update_multi5;
t.drop()
t.insert({path: 'r1', subscribers: [1,2]});
t.insert({path: 'r2', subscribers: [3,4]});
t.update({}, {$addToSet: {subscribers: 5}}, false, true);
t.find().forEach(
function(z){
assert.eq( 3 , z.subscribers.length , z );
}
);