Articles → MONGODB → Arrayfilters Feature In Mongodb
Arrayfilters Feature In Mongodb
Purpose
Example
db.mycollection.updateOne(
{ "_id": 1 },
{
$set: { "scores.$[element].score": 95 }
},
{
arrayFilters: [ { "element.type": "quiz", "element.score": 90 } ]
}
)
Output