Solution: Update a Record
We'll cover the following...
Query
db.orders.updateMany({ status: "Cancelled" },{ $set: { status: "Closed" } }), db.orders.find()
The explanation of the query is given below:
Line 1:
db.orders.updateMany(, this command tells MongoDB to update multiple documents in theorderscollection that match the filter you provide. UseupdateManywhen you ...