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 the age field is greater than 25.
Complete the code to find documents where status is 'active' and score is at least 80.
db.collection.find({ $and: [ { status: '[1]' }, { score: { $gte: 80 } } ] })The query uses $and to combine conditions. We want status to be 'active', so we fill in 'active'.
Fix the error in the query to find documents where age is less than 30 or score is greater than 90.
db.collection.find({ $or: [ { age: { $[1]: 30 } }, { score: { $gt: 90 } } ] })The operator $lt means 'less than'. We want age less than 30, so $lt is correct.
Fill both blanks to find documents where status is 'pending' and age is not equal to 40.
db.collection.find({ $and: [ { status: '[1]' }, { age: { $[2]: 40 } } ] })The query uses $and to combine conditions. Status should be 'pending' and age should not equal 40, so we use $ne for 'not equal'.
Fill all three blanks to find documents where name starts with 'J', age is greater than 20, and score is less than or equal to 100.
db.collection.find({ $and: [ { name: { $regex: '^[1]' } }, { age: { $[2]: 20 } }, { score: { $[3]: 100 } } ] })The regex ^J matches names starting with 'J'. Age should be greater than 20, so $gt. Score should be less than or equal to 100, so $lte.