Complete the code to find all documents in the collection.
db.collection.[1]()The find() method retrieves all documents from a MongoDB collection.
Complete the code to filter documents where age is greater than 25.
db.collection.find({ age: { [1]: 25 } })The $gt operator means 'greater than' in MongoDB queries.
Fix the error in the aggregation pipeline to group by 'category'.
db.collection.aggregate([{ $group: { _id: "$ [1]" } }])The field name must exactly match the document field, which is 'category'.
Fill both blanks to project only the 'name' and 'score' fields in the output.
db.collection.find({}, { [1]: 1, [2]: 1 })Projection specifies which fields to include. Here, 'name' and 'score' are included.
Fill all three blanks to update the 'status' field to 'active' for documents where 'age' is less than 30.
db.collection.updateMany({ age: { [1]: 30 } }, { [2]: { [3]: "active" } })The query uses $lt to find ages less than 30, then $set to update the 'status' field to 'active'.