The quantity condition is “less than or equal to 1000,” which maps to MongoDB ' s $lte comparison operator. The sales representative condition is “not equal to Anne,” which maps to $ne. When predicates on two different fields appear in the same query document, MongoDB applies an implicit logical AND, so both conditions must be true for a document to match. Option C therefore expresses exactly the requested filter: { quantity: { $lte: 1000 }, salesRep: { $ne: " Anne " } }. Options A and D use $neq, which is not MongoDB ' s inequality operator. Options B and D use $lt, which excludes documents whose quantity is exactly 1000 and therefore fails the “less than or equal” requirement. One nuance of $ne is that it can also match documents where the field is missing, because a missing field is not equal to the specified value. If the application requires salesRep to exist as well, an explicit existence predicate may be appropriate. For the wording shown, however, option C is the correct command.
Study Guide reference/topic:MongoDB Architecture and Core Operations - comparison predicates, $lte, $ne, and implicit AND semantics.
===========
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit