Saturday, 13 October 2018

update many nested objects in mongoose

is there a way to update many nested objects in mongoose all at once ? i can update one nested object like this :Model.findOneAndUpdate( {name : watchlistName , "mentions.id" : 123}, { $set : { "mentions.$.tone" : positive, "mentions.$.verified" : true } }, function (err) { if(err) { console.log(err); } } ); but if i have let's say 200 id to update, how should i proceed ?

Submitted October 13, 2018 at 04:02PM by SuspiciousTaco

No comments:

Post a Comment