Complete the code to update one document in the collection.
db.collection.updateOne({ name: "John" }, { [1]: { age: 30 } })The $set operator updates the value of a field in the matched document.
Complete the code to update the first document where age is 25.
db.users.updateOne({ age: [1] }, { $set: { status: "active" } })The query filter should match the number 25, not the string "25".
Fix the error in the updateOne call to increment the score by 5.
db.scores.updateOne({ player: "Alice" }, { [1]: { score: 5 } })The $inc operator increments a numeric field by the given value.
Fill both blanks to update the city and add a new field country.
db.customers.updateOne({ name: "Bob" }, { [1]: { city: "Paris" }, [2]: { country: "France" } })Use $set to update or add fields in the document.
Fill all three blanks to update the user's email, increment login count, and remove the temp field.
db.users.updateOne({ username: "jane" }, { [1]: { email: "jane@example.com" }, [2]: { logins: 1 }, [3]: { temp: "" } })$set updates the email, $inc increments the login count, and $unset removes the temp field.
