Complete the code to find documents where the field 'status' is not equal to 'active'.
db.collection.find({ status: { [1]: "active" } })The $ne operator selects documents where the value of the field is not equal to the specified value.
Complete the code to find documents where the 'age' field is not equal to 30.
db.users.find({ age: { [1]: 30 } })The $ne operator is used to find documents where the 'age' is not 30.
Fix the error in the query to find documents where 'category' is not 'books'.
db.products.find({ category: [1] })The correct syntax requires the $ne operator inside an object with the value, like { $ne: "books" }.
Fill both blanks to find documents where 'status' is not 'pending' and 'priority' is not 1.
db.tasks.find({ status: { [1]: "pending" }, priority: { [2]: 1 } })Both conditions use $ne to exclude documents with those exact values.
Fill all three blanks to find documents where 'type' is not 'admin', 'score' is not 100, and 'active' is not false.
db.users.find({ type: { [1]: "admin" }, score: { [2]: 100 }, active: { [3]: false } })All three fields use $ne to exclude documents with those exact values.