Is it possible to update a number of records in the model of a mongoose?

Hello!
Can I upgrade for just a few records?
Now we have to do this sheet:

array.forEach((item, i) => {
User.updateOne(
 { id: item.id },
{
 $push: {
 history: {
 val: item.val
}
}
},
() => {})
})


Is there a better option? Thank you in advance.
April 19th 20 at 12:42
1 answer
April 19th 20 at 12:44
updateMany

Find more questions by tags Node.jsMongoose