+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” } })

Related questions

0 votes
asked Jan 30 in AJAX by rajeshsharma
0 votes
asked Jan 6, 2023 in MongoDB by sharadyadav1986
...