I'm trying to run a multiple update of a field of an object in an array. The structure is like:
{
rs:[
{uid:"123", ufc:"bla"},
{uid:"123", ufc:"foo"},
//...
]
}
For some reason only the first field is updated. I read I have to use multi:true
to solve this, but it's still the same.
I tried:
db.mycollection.update({"rs.uid": "123"},
{$set: {"rs.$.ufc":"test"}},
false, true
)
And:
db.mycollection.update({"rs.uid": "123"},
{$set: {"rs.$.ufc":"test"}},
{multi: true}
)
Probably related with the nested structure? Thanks.