-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
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.
- duplicates
-
SERVER-27089 Extend the update subsystem to support more expressive updates to array fields
-
- Closed
-
- related to
-
SERVER-29515 Invalid "cannot use part of (results of results.answers) to traverse elemt
-
- Closed
-