I am trying to update a field named totalTime of subobject named livePerfMeasure . I used the query as below
db.BasicVariable.runCommand("findandmodify", {"query" : { "_id" : "test_test_test_4.4.x_/api/campaingmngmt/campaign/getById" }, "update" : { "$set" : { "dateTime" : ISODate("2012-09-27T06:01:04.000Z")} , "$inc" : { "lifetimeCounterValue" : 1}, "livePerfMeasure" : { "$inc" : { "totalTime" : 300}} }})
But I get the following error
"errmsg" : "exception: assertion src/mongo/db/ops/update_internal.h:253",
"code" : 0,
"ok" : 0
Only if I use the dot notation for the key attribute like "$inc" : { "livePerfMeasure.totalTime" : 300}, my query works. So is there any problem with the above query ? Pls help