Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
3.4.1
-
None
-
ALL
Description
I have next document:
{
|
"_id" : ObjectId("58821b8100e83a84ae110fbd"), |
"a" : [ { "id" : 4, "group" : "a", "k" : "v1" }, |
{ "id" : 4, "group" : "b", "k" : "v2" } ] |
}
|
and I want to replace 'v2' by 'v_new' using $set and $and in the query:
update({$and: [{'a.group': 'b'}, {'a.id': 4}] }, {'$set': {'a.$.k': 'v_new'} }) |
But it replaces 'v1' by 'v_new' ($ refers to wrong element of array 'a').