Reputation: 7540
For an instance I have a json document in mongodb
{
a:{b:c}
}
Now what am I suppost to do if I want to add to a nested json which will make it look like:
{
a:{b:c, d:e}
}
I have read the documentation of update
. It has documented about $inc
, $rename
, $set
& $unset
. But I want it to add with existing elements of a
. just like $addToSet
do with an array.
Upvotes: 1
Views: 1076