Search⌘ K
AI Features

Write Query: Update a Record

To update the status of orders in the MongoDB orders collection, the task involves changing all instances of the status "Cancelled" to "Closed." This update is necessary to align with the company's new terminology for finalized orders. The expected output after executing the update query includes confirmation of the operation, with details on the number of documents matched and modified.

We'll cover the following...

Question

Given the following sample documents from the orders collection:

[
  {
    "_id": "3a758b14e7e292cf190b1ac5",
   
...
...