Complete the code to update the first matching element in the array using the positional $ operator.
db.collection.updateOne({ 'items.name': 'apple' }, { $set: { 'items.[1].quantity': 10 } })The positional $ operator updates the first matching element in the array.
Complete the code to increment the quantity of the matched array element by 5 using the positional $ operator.
db.collection.updateOne({ 'items.name': 'banana' }, { $inc: { 'items.[1].quantity': 5 } })The positional $ operator targets the matched element to increment its quantity.
Fix the error in the update query by correctly using the positional $ operator to set the price of the matched item.
db.collection.updateOne({ 'products.code': 'X123' }, { $set: { 'products.[1].price': 20 } })The positional $ operator must be used to update the matched array element.
Fill both blanks to update the quantity and price of the matched array element using the positional $ operator.
db.collection.updateOne({ 'orders.id': 101 }, { $set: { 'orders.[1].quantity': 15, 'orders.[2].price': 30 } })Use the positional $ operator in both places to update the matched element's fields.
Fill all three blanks to update the quantity, price, and status of the matched array element using the positional $ operator.
db.collection.updateOne({ 'inventory.sku': 'A1B2' }, { $set: { 'inventory.[1].quantity': 50, 'inventory.[2].price': 99.99, 'inventory.[3].status': 'in stock' } })Use the positional $ operator for all fields to update the matched array element correctly.