-
Type: Bug
-
Resolution: Duplicate
-
Priority: Critical - P2
-
None
-
Affects Version/s: 2.4.3
-
Component/s: Querying
-
None
-
Environment:Windows, Linux.
-
ALL
It seems that i can go further than one subdocument if i want to add it dynamicaly, here is the code:
db.users.update(
{"pup.cmn.id":id}, {"$addToSet":{"pup.cmn":
{"abus":email}}})
this give error:
OperationFailure: can't append to array using string field name: cmn
then, if i add positional element i get this:
db.users.update(
{"pup.cmn.id":id}, {"$addToSet":{"pup.$.cmn":
{"abus":email}}})
"cmn" :
[
{
"fto" : ObjectId("5190e8a53a5f3a0c102af045")
"id" : "14.05.2013 12:29:53"
},
{
"abus" : "u...@example.com"
}
]
so as you can see, it will add it in the same level, and i dont want that, because the application will get errors.
- duplicates
-
SERVER-831 Positional Operator Matching Nested Arrays
- Closed