Complete the code to find documents where age is greater than 25.
db.collection.find({ age: { $[1]: 25 } })The operator $gt means 'greater than'. So this query finds documents where age is greater than 25.
Complete the code to find documents where age is less than or equal to 30.
db.collection.find({ age: { $[1]: 30 } })The operator $lte means 'less than or equal to'. This query finds documents where age is 30 or less.
Fix the error in the query to find documents where age is between 20 and 40 (inclusive).
db.collection.find({ age: { $gte: 20, $[1]: 40 } })To include 40 in the range, use $lte (less than or equal to). Using $lt would exclude 40.
Fill both blanks to find documents where score is greater than 50 and less than 100.
db.collection.find({ score: { $[1]: 50, $[2]: 100 } })The query uses $gt for greater than 50 and $lt for less than 100, so it finds scores between 51 and 99.
Fill all three blanks to find documents where price is greater than or equal to 10, less than 50, and not equal to 30.
db.collection.find({ price: { $[1]: 10, $[2]: 50, $[3]: 30 } })This query finds prices 10 or more, less than 50, and excludes price 30 using $ne.