[SERVER-9726] cant append for subdocument level 2 Created: 18/May/13  Updated: 18/May/13  Resolved: 18/May/13

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.4.3
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: abdelouahab Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows, Linux.


Issue Links:
Duplicate
duplicates SERVER-831 Positional Operator Matching Nested A... Closed
Operating System: ALL
Participants:

 Description   

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.



 Comments   
Comment by abdelouahab [ 18/May/13 ]

ah so it has been already asked! sorry

Comment by Scott Hernandez (Inactive) [ 18/May/13 ]

The feature you want does not exist yet. Please vote/watch SERVER-831 to keep track of its progress.

Generated at Thu Feb 08 03:21:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.