I need to update several documents by providing them in the body. I can\'t query them, they must be provided.
Example:
var persons = [ {id: 1, name
Try using the update command along with the "$in" operator:
var ids= []; for (var i=0 i<input.body.length; ++i) { ids.push(input.body[i].id); } mongoose.model('person').update( {id : {"$in":ids}}, {active:false} , {multi: true} , function(err,docs) { ... });
Hope this helps