I have a collection that has documents looks something like this:
{
_id : 21353456,
product : "xy",
text : "asdf",
reviews : [
{
username : "User1",
userID: 12
text : "hi",
},
{
username : "User2",
userID: 123
text : "hi1",
}
]
}
I want to remove the field in username from the objects in this array. I tried this db.collection.update({}, {$unset: {"reviews.username": 1}}, {multi: true}) I tried with even updateMany and it just matchedCouunt and acknowledged.