I need help in updating MONGO DB. here is my document:
Functions : {
"cgi0-app" : {
"calculatedConfigValues" : {
"floor" : 0.0 ,
"ceiling" : 49.0 ,
"calculatedBrokenValue" : 2.033 },
"userConfigValues" : null },
"shop-app" : {
"calculatedConfigValues" : {
"floor" : 0.0 ,
"ceiling" : 70.0 ,
"calculatedBrokenValue" : 2.413 } } }
I am trying to update shop-app's "ceiling" value from 70 to 100 in MongoDB, but not successful. Here is my Code:
BasicDBObject find = new BasicDBObject("Functions.shop app.calculatedConfigValues.floor",0);
BasicDBObject set = new BasicDBObject("$set", new BasicDBObject("Functions.shop- app.calculatedConfigValues.$.ceiling", 100);
getDB().update(find, set);
Can someone please help me what I am doing wrong?