[SERVER-23147] Error updating deep nested array with positional operator Created: 15/Mar/16  Updated: 16/Mar/16  Resolved: 15/Mar/16

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

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

Issue Links:
Duplicate
is duplicated by SERVER-23166 Updating deep nested array in embedde... Closed
Operating System: ALL
Participants:

 Description   

Updating in deep nested array positional operator error i cant able to update array of documents in deep nested array..the positional operator matches only the first level of array



 Comments   
Comment by Ramon Fernandez Marina [ 16/Mar/16 ]

shibish, the SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag, where your question will reach a larger audience. A question like this involving more discussion would be best posted on the mongodb-user group. See also our Technical Support page for additional support resources.

Regards,
Ramón.

Comment by shibimukesh [ 16/Mar/16 ]

{"_id":1,"sortname":"AF","country_name":"Afghanistan","stateinfo":[{"_id":

{"state_id":42,"name":"Badakhshan","country_id":1,"cityinfo":["city_id":5909,"city_name":"Eshkashem","state_id":42}

,{"_id":

{"city_id":5910,"city_name":"Fayzabad","state_id":42}

,{"_id":

{"city_id":5911,"city_name":"Jurm","state_id":42}

,{"_id":

{"city_id":5912,"city_name":"Khandud","state_id":42}

,{"_id":

{"city_id":5913,"city_name":"Qal-eh-ye Panjeh","state_id":42}

]},{"_id":{"state_id":43,"name":"Badgis","country_id":1,"cityinfo":[{"_id":

{"city_id":5914,"city_name":"Bala Morghab","state_id":43}

,

{"city_id":5915,"city_name":"Qal-eh-ye Naw","state_id":43}

]}}}}}}}}

this is my collection can u please help me how to update "city_id":5911
under _id:1 state_id:42

Best Regards,

*Shibi.M*Hadoop Developer

<http://www.ndottech.com/>

NDOT Technologies Pvt Ltd,
Block No 3,
1,2 & 3rd Floor,
Mullai Nagar,
Coimbatore - 641041.
Phone: +91 422-434-2518, 519

shibi.m@ndot.in

US : +1 (323) 982-8943
<https://www.facebook.com/ndotin>
<https://www.linkedin.com/company/ndot-technologies>
<http://twitter.com/ndottechnology>

<http://www.ndot.in/>Enterprise Mobility – CRM – ERP – Mobile – Web –
Software – Hire Team – Ecommerce

INDIA (HQ) - Singapore - United States - Dubai - Morocco – Spain -
Venezuela

DISCLAIMER:

The information contained in this message (including any attachments) is
confidential and may be privileged. If you have received it by mistake
please notify the sender by return e-mail and permanently delete this
message and any attachments from your system. Any dissemination, use,
review, distribution, printing or copying of this message in whole or in
part is strictly prohibited. Please note that e-mails are susceptible to
change. NDOT Technologies Pvt Ltd (including its group companies) shall
not be liable for the improper or incomplete transmission of the
information contained in this email.

Comment by shibimukesh [ 16/Mar/16 ]

We have a collection with country state city, while trying to update in
deep nested array ie., city using positional operator it shows error using
too many positional operator..
In order to make the update, I need to know the position of the city
document out of the following cities. but this is not a proper way to
update can u pls bring the solution for this

Best Regards,

*Shibi.M*Hadoop Developer

<http://www.ndottech.com/>

NDOT Technologies Pvt Ltd,
Block No 3,
1,2 & 3rd Floor,
Mullai Nagar,
Coimbatore - 641041.
Phone: +91 422-434-2518, 519

shibi.m@ndot.in

US : +1 (323) 982-8943
<https://www.facebook.com/ndotin>
<https://www.linkedin.com/company/ndot-technologies>
<http://twitter.com/ndottechnology>

<http://www.ndot.in/>Enterprise Mobility – CRM – ERP – Mobile – Web –
Software – Hire Team – Ecommerce

INDIA (HQ) - Singapore - United States - Dubai - Morocco – Spain -
Venezuela

DISCLAIMER:

The information contained in this message (including any attachments) is
confidential and may be privileged. If you have received it by mistake
please notify the sender by return e-mail and permanently delete this
message and any attachments from your system. Any dissemination, use,
review, distribution, printing or copying of this message in whole or in
part is strictly prohibited. Please note that e-mails are susceptible to
change. NDOT Technologies Pvt Ltd (including its group companies) shall
not be liable for the improper or incomplete transmission of the
information contained in this email.

On Tue, Mar 15, 2016 at 8:34 PM, Ramon Fernandez (JIRA) <jira@mongodb.org>

Comment by Ramon Fernandez Marina [ 15/Mar/16 ]

This is expected behavior as described in the documentation:

The positional $ operator cannot be used for queries which traverse more than one array, such as queries that traverse arrays nested within other arrays, because the replacement for the $ placeholder is a single value

Regards,
Ramón.

Generated at Thu Feb 08 04:02:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.