Complete the code to find documents where the field 'status' is not in the list ['A', 'D'].
db.collection.find({ status: { [1]: ['A', 'D'] } })The $nin operator selects documents where the value of the field is not in the specified array.
Complete the code to find documents where 'category' is not in the array ['electronics', 'furniture'].
db.products.find({ category: { [1]: ['electronics', 'furniture'] } })The $nin operator filters out documents where 'category' matches any value in the given array.
Fix the error in the query to find documents where 'type' is not in ['admin', 'guest'].
db.users.find({ type: { [1]: ['admin', 'guest'] } })The correct operator to exclude multiple values is $nin. Using $in or $ne will not exclude all listed values properly.
Fill both blanks to find documents where 'color' is not in ['red', 'blue'] and 'size' is not in ['small', 'medium'].
db.items.find({ color: { [1]: ['red', 'blue'] }, size: { [2]: ['small', 'medium'] } })Both fields use $nin to exclude the listed values.
Fill all three blanks to find documents where 'status' is not in ['active', 'pending'], 'role' is not in ['admin', 'user'], and 'age' is not in [20, 30].
db.members.find({ status: { [1]: ['active', 'pending'] }, role: { [2]: ['admin', 'user'] }, age: { [3]: [20, 30] } })All three fields use $nin to exclude the specified values.