Basic Commands On Mongo Shell
Basic Commands On Mongo Shell
Update
If a new field is coming for update, that field will be added to the document.
db.people.updateMany({name: 'Tom'},{$set:{age: 30, salary:50000}})
// Document will have `salary` field as well.