I have a mongoDB collection like this:
{
"_id" : ObjectId("54bd056621396c50b6da3d4
"name" : "Nagaland",
"districts" : [
{
"name" : "Wokha",
"population" : {
"2011" : 161223
}
},
{
"name" : "Mokokchung",
"population" : {
"2011" : 232085
}
},
{
"name" : "Zunheboto",
"population" : {
"2011" : 153955
}
}
]}
Now later I want to add some more attributes to each of the districts like location,sex-ratio etc. How do I do it? When I use update it is adding to the parent not inside a particular district.