Answer the question
In order to leave comments, you need to log in
How to change objects through array and id?
There is an iduser and an array of id objects. How can one intelligently change the del field in certain objects by id from the array to satisfy iduser? Do so?
arraylist.map(e=>{
return Todo.update({ $and: [{idUser: iduser}, {iditem: e.id}], {del: '+'} })
})
Answer the question
In order to leave comments, you need to log in
Something like this:
Todo.update({
idUser: iduser,
iditem: {
$in: arraylist
}
}, { del: '+' }, { multi: true });
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question