Complete the code to multiply the field 'price' by 2 in the update operation.
db.products.updateOne({ _id: 1 }, { $mul: { price: [1] } })The $mul operator multiplies the value of the specified field by the given number. Here, multiplying 'price' by 2 doubles its value.
Complete the code to multiply the 'quantity' field by 5 for all documents matching the filter.
db.inventory.updateMany({ category: 'books' }, { $mul: { quantity: [1] } })The $mul operator requires a number to multiply the field. Here, 5 is the correct multiplier.
Fix the error in the update command to multiply 'score' by 3.
db.scores.updateOne({ user: 'alice' }, { $mul: { score: [1] } })The multiplier must be a number without quotes or dollar sign. Using 3 correctly multiplies the 'score' field by 3.
Fill both blanks to multiply 'price' by 1.5 and 'stock' by 10 in a single update.
db.store.updateOne({ _id: 10 }, { $mul: { price: [1], stock: [2] } })Both multipliers must be numbers without quotes. 1.5 multiplies 'price' and 10 multiplies 'stock'.
Fill all three blanks to multiply 'rating' by 2, 'views' by 100, and 'likes' by 5 in one update.
db.analytics.updateMany({ active: true }, { $mul: { rating: [1], views: [2], likes: [3] } })All multipliers must be numbers without quotes. 2 for 'rating', 100 for 'views', and 5 for 'likes' correctly apply the multiplication.