MongoDB -Inkrement -Array -Element
await Model.findOneAndUpdate({
id: postId,
'array.id': itemId
}, {
$inc: {
'array.$.some_field': -1
}
})
florinrelea
await Model.findOneAndUpdate({
id: postId,
'array.id': itemId
}, {
$inc: {
'array.$.some_field': -1
}
})