users with documents containing a subscribed field that can be true, false, or null, which query returns only users who have subscribed set to false (not null or missing)?db.users.find({ subscribed: false })false is different from null and missing fields.Query B matches documents where subscribed is exactly false (not null or missing). Query A matches documents where subscribed exists and is not true, so it includes false and null. Query C matches documents where subscribed does not exist. Query D matches documents where subscribed is null.
null and a field that is missing in a document?A field set to null is present in the document with a value of null. A missing field is not present at all. This affects how queries like {field: null} behave.
active field is either true or null?db.collection.find({ $or: [{ active: true }, { active: null }] })Option D uses $or correctly to find documents where active is true or null. Option D uses $in which also works but is less explicit. Option D is invalid syntax. Option D uses $or incorrectly inside a field.
verified field is either false or does not exist. Which query is the most efficient and correct?Option A explicitly checks for verified being false or missing using $or and $exists. Option A matches documents where verified exists and is not true, so includes false and null (but not missing fields or other values). Option A is invalid because it tries to match two conditions on the same field in one object. Option A includes false and null (existing fields) but not missing fields.
db.orders.find({ status: false || null })The expression false || null evaluates to null in JavaScript before the query runs. So the query becomes { status: null }, ignoring false. This is not a syntax error but a logic mistake.