Complete the code to find all orders for a customer with ID 123.
db.orders.find({ customer_id: [1] })The customer_id field stores the customer's ID as a number, so we query with 123 without quotes.
Complete the code to insert a new order referencing customer ID 456.
db.orders.insertOne({ order_id: 1, customer_id: [1], items: 0 })customer_id.The customer_id should match the type used in the database, which is a number here.
Fix the error in the query to find orders for customer ID 789.
db.orders.find({ customer_id: [1] })The customer_id is stored as a number, so the query must use the number 789 without quotes or ObjectId.
Fill both blanks to create a query that finds orders with more than 2 items for customer ID 101.
db.orders.find({ customer_id: [1], items: { $[2]: 2 } })$gte instead of $gt for strictly more than 2.We query for customer_id 101 and use $gt to find orders with more than 2 items.
Fill all three blanks to update the customer name for customer ID 202.
db.customers.updateOne({ _id: [1] }, { $[2]: { name: [3] } })_id.$update.The query matches the customer with _id 202 (number), uses $set to update, and sets the name to "Alice".