Mongo db update on array object -
{ "_id" : objectid("4faaba123412d654fe83hg876"), "user_id" : 123456, "total" : 100, "items" : [ { "item_name" : "my_item_one", "price" : 20, "veriety": [{ color:"red", make:"plastic" },{color:"green", make:"metal" }] }, { "item_name" : "my_item_two", "price" : 50, "veriety":[ { color:"red", make:"plastic" } ] }, { "item_name" : "my_item_three", "price" : 30, "veriety":[ { color:"red", make:"plastic" } ] } ] }
in case want update color price 30 , "total" 100, ......how can it?
Comments
Post a Comment