Operational Defect Database

BugZero found this defect 2450 days ago.

MongoDB | 392025

[SERVER-29526] Updating the specific array in nested subdocument

Last update date:

6/9/2017

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

Hello All, I have a similar situation I guess, the following is the sample Json document in which I need to query on. { "_id" : ObjectId("591d601fc9f360331cd4668c"), "Type" : "district", "GroupId" : "00000000-0000-0000-0000-000000000456", "Grades" : [ { "GroupId" : "gs00000000-0000-0000-0000-000000000452", "Categories" : [ { "Sequence" : 1, "Low" : 0, "High" : 99, "Min" : 0, "Max" : 0, }, { "Sequence" : 1, "Low" : 50, "High" : 99, "Min" : 0, "Max" : 0, } ] } ], "NumberOfTypes" : 4, "CreatedDate" : ISODate("2017-05-18T08:49:35.433Z"), "LastModifiedDate" : ISODate("2017-05-26T16:12:52.093Z"), "Status" : true } I need to pick all the document where the value of "Low": 0 and change to 1. I am trying the following query db.BenchmarkDetails.update( {"Grades.Categories.Low" : 0}, {$set : {"Grades.Categories.$.Low" : 1} } ) This throwing the error cannot use the part (Grades of Grades.Categories.0.Low) to traverse the element.

Top User Comments

thomas.schubert commented on Fri, 9 Jun 2017 15:10:02 +0000: Hi katakam.maniratnam@gmail.com, Thanks for your reporting this issue. We're working on improving array updates for MongoDB 3.6. Please free feel to watch SERVER-27089 for updates. See also the conversation on SERVER-29515 regarding recent work in this space. Thanks again, Thomas

Additional Resources / Links

Share:

BugZero Risk Score

Coming soon

Status

Closed

Have you been affected by this bug?

cost-cta-background

Do you know how much operational outages are costing you?

Understand the cost to your business and how BugZero can help you reduce those costs.

Discussion

Login to read and write comments.

Have you ever...

had your data corrupted from a

VMware

bug?

Search:

...