I am having following document in mongodb
{
"CompanyCode" : "xyz",
"TktDetail" : [
{
"Type" : "ab yyy (123+4)",
"Qty" : [{
"1-Aug" : 48
}, {
"1-Sep" : 42
}]
},
{
"Type" : "bc xyz (123+4)",
"Qty" : [{
"10-Aug" : 2
}, {
"10-Sep" : 2
}, {
"11-Sep" : 2
}]
}]
}
I want to update the 1-Aug value in the Qty array which is embedded inside the TktDetail array.
I had tried with the following query.Its not updating
db.test.update({"CompanyCode":"xyz","TktDetail.type":"ab yyy (123+4)"},{$set:{"TktDetail.$.Qty.$.1-Aug":55}});
Any help will be great.