+1 vote
in MongoDB by
In MongoDB how do you use $set to update a nested value in MongoDB?

1 Answer

0 votes
by
In MongoDB how do you use $set to update a nested value in MongoDB?

Using the dot notation:

db.people.update({ }, { $set: { “address.street”: “Main Street” } })
...