{
_id: 1,
name: 'Some event',
items: [{
status: 'NEW',
value: 'one'
},{
status: 'NEW',
value: 'two'
}]
}
I need to update each status to the PENDING
This is doesn't work(
findOneAndUpdate({ _id: event.id },
{
$set: {
'items.$.status': "PENDING",
},
},
{
new: true,
upsert: true,
}),
The main idea that i need to update each status field without any conditions because I already have the needed item and it just update status before next action.