Ask to write a mongoose query statement.

  mongodb, question

clipboard.png

Query all those with a quantity of 10. Then change their sku to “‘abc'” and add 5 to their orders.

Shell is written as follows:

db.<collection>.updateMany({
 quantity: 10
 }, {
 $set: { sku: "abc" },
 $inc: { "metrics.orders": 5 }
 });

Rewrite it yourself against mongoose’s API.