In MongoDB how do you use $set to update a nested value/embedded document?
Solution 1:
Using the dot notation:
db.people.update({ }, { $set: { "address.street": "Main Street" } })
Solution 2:
In addition to Niels' answer, also do verify the "type" of the nested value. In my case, it was a "string" formed from json. Though this might be unlikely, but do ensure that the value has the right type.