Tsallaka zuwa abun ciki
Justice Tech School

Positional Update

The $ operator updates the matched array item.

Example
db.orders.updateOne(
  { _id: 1, "items.sku": "a1" },
  { $set: { "items.$.qty": 3 } }
)

Exercise

Matched item.

"items..qty"

Quiz Test

What does $ stand for?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.