Monday, 24 April 2017

Mongodb update more than 499 doc

I need to update many docs.

User.updateMany({
        email: { $in : emailsInArray }
    },{
        $set: {
            //something
        } 
    },{
        multi:true
    }, function (err, result) {
        console.log(result.nModified);
    }
);

I use mongoose and when i have more than 499 emails in array nModified is magnified by 1.

When emails length is 500 I get nModified equal 501.

Why this happens?



via mcek

No comments:

Post a Comment