Complete the code to find documents where age is greater than 25 and status is "A" using $and.
db.collection.find({ $and: [ { age: { $gt: [1] } }, { status: "A" } ] })The $gt operator checks if age is greater than 25, so 25 is the correct value to use.
Complete the code to find documents where score is at least 80 and grade is "B" using $and.
db.collection.find({ $and: [ { score: { $gte: [1] } }, { grade: "B" } ] })The $gte operator means 'greater than or equal to'. To find scores at least 80, use 80.
Fix the error in the query to correctly use $and to find documents where city is "NY" and age is less than 30.
db.collection.find({ $and: [ { city: "NY" }, { age: { $lt: [1] } } ] })The $lt operator expects a number, so 30 without quotes is correct.
Fill both blanks to find documents where status is "A" and score is greater than 70 using $and.
db.collection.find({ $and: [ { status: [1] }, { score: { $gt: [2] } } ] })Status is a string, so use "A" with quotes. Score is a number, so use 70 without quotes.
Fill all three blanks to find documents where age is at least 18, city is "LA", and active is true using $and.
db.collection.find({ $and: [ { age: { $gte: [1] } }, { city: [2] }, { active: [3] } ] })Age is a number (18), city is a string ("LA"), and active is a boolean (true).