Let say i have the following array:
[
{_id: 1, status: "Active"},
{_id: 2, status: "Delete"},
{_id: 10, status: "Pause"},
{_id: 20, status: "Active"}
]
And i want to update the field status in collection users with a single mongoDB call using mongoose. (Update only documents with _id = 1,2,10,20)
My Schema can look like this:
var userScheme = new Schema({
fname : String,
lname : String,
status : String,
email : String
});
db.model('user', userScheme);
NOTE: I want to use updateMany and not update