summaryrefslogtreecommitdiff
path: root/jstests/update_multi5.js
blob: 46ef8f36da5bfa8c43be3058b578276428cd9d7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

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 );
    }
);