Complete the code to update all elements in the array field 'scores' by setting them to 100.
db.students.updateMany({}, { $set: { "scores[1]": 100 } })The $[] operator updates all elements in the array.
Complete the code to increment all elements in the 'grades' array by 5.
db.courses.updateMany({}, { $inc: { "grades[1]": 5 } })The $[] operator targets all elements in the array for the increment.
Fix the error in the code to set all elements in 'ratings' array to 5.
db.products.updateMany({}, { $set: { "ratings[1]": 5 } })Using $[] updates all elements; .$ updates only the first.
Fill both blanks to multiply all elements in 'values' array by 2.
db.data.updateMany({}, { $mul: { "values[1]": [2] } })The $[] operator targets all array elements, and $mul multiplies by the given number.
Fill both blanks to add 10 to all elements in 'scores' array and set 'updated' to true.
db.records.updateMany({}, { $inc: { "scores[1]": [2] }, $set: { "updated": true } })$[] updates all array elements, $inc adds 10, and $set sets the 'updated' field (no array operator needed).