Complete the code to find documents where the field 'color' matches any value in the list.
db.collection.find({ color: { [1]: ["red", "blue", "green"] } })The $in operator matches any of the values specified in the array.
Complete the code to find documents where the 'status' field is either 'active' or 'pending'.
db.users.find({ status: { [1]: ["active", "pending"] } })The $in operator matches documents where the field's value is in the specified array.
Fix the error in the query to correctly find documents where 'category' is one of the specified values.
db.products.find({ category: { [1]: ["electronics", "furniture"] } })The $in operator requires an array of values, so the values must be inside brackets [].
Fill both blanks to find documents where 'tags' contain any of the specified values.
db.articles.find({ tags: { [1]: ["mongodb", "database"], [2]: true } })The $in operator matches any value in the array, and $exists: true ensures the 'tags' field exists.
Fill all three blanks to find documents where 'status' is in the list and 'score' exists and is greater than 50.
db.records.find({ status: { [1]: ["open", "closed"] }, score: { [2]: true, [3]: 50 } })$in matches status values, $exists: true ensures 'score' field exists, and $gt: 50 filters scores greater than 50.