Complete the code to find all documents in the collection.
db.collection.[1]({})The find method retrieves documents from a MongoDB collection.
Complete the code to limit the number of documents returned to 5.
db.collection.find({}).[1](5)The limit method restricts the number of documents returned by a query.
Fix the error in the code to find documents where age is greater than 30.
db.collection.find({ age: { [1]: 30 } })The $gt operator means 'greater than' in MongoDB queries.
Fill both blanks to find documents where status is 'active' and sort by age ascending.
db.collection.find({ status: [1] }).[2]({ age: 1 })Use 'active' as the value for status and sort to order results by age ascending.
Fill all three blanks to find documents where score is greater than 80, limit to 3, and sort by score descending.
db.collection.find({ score: { [1]: 80 } }).[2](3).[3]({ score: -1 })Use $gt to filter scores greater than 80, limit to restrict results to 3, and sort with -1 for descending order.