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

▼ Show 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” } })
Learn More with Madanswer
...