-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.3
-
Component/s: Write Ops
-
None
-
ALL
-
Running an "unset" on a key inside of array objects says it updated documents but it didn't.
Example doc:
{ "_id" : ObjectId("52c5e5d2bd546795dee87ca4"), "c" : [ {"pi" : NumberLong(2368999)}, {"pi" : NumberLong(2368999)}, {"pi" : NumberLong(2368999)} ] }
Example query:
db.example.update({_id: ObjectId("52c5e5d2bd546795dee87ca4")}, {$unset: {"c.pi": 1}})
When I run that query using the PHP driver it returns:
"updatedExisting"= > true
"n" => 1
However nothing was actually unset. I know there's another bug filed (SERVER-1243) for a feature request to use a position operator on multiple items, but this should have affected ALL items in the collection, I'm not using $elemMatch or anything else. Is that not supported?
I said affects versions 2.2.3 because that's all we have running at Grooveshark but it might affect newer versions.
- duplicates
-
SERVER-1243 New operator to update all matching items in an array
- Closed