You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When filtering on a specific field of the objects within an array with $nin, I expect a document to match if no object in the array has that field matching the $nin. But currently, if any object within the array has that field not matching the $nin, the document is returned.
This behaviour differs from e.g. CosmosDb.
When filtering for documents where the tags array doesn't contain a tag with value B or C, I expect only the first document to be returend, but the second and third document are also returned because they contain {'value': 'A'} which matches $nin: [ 'B', 'C']
The text was updated successfully, but these errors were encountered:
kareldh
changed the title
$nin on field of object in array returns documents where that field does match a value from the array
$nin on field of object in array returns documents if any object in the array matches the $nin instead of all objects matching the $nin
Feb 1, 2023
When filtering on a specific field of the objects within an array with $nin, I expect a document to match if no object in the array has that field matching the $nin. But currently, if any object within the array has that field not matching the $nin, the document is returned.
This behaviour differs from e.g. CosmosDb.
Example
When filtering for documents where the tags array doesn't contain a tag with value B or C, I expect only the first document to be returend, but the second and third document are also returned because they contain {'value': 'A'} which matches $nin: [ 'B', 'C']
The text was updated successfully, but these errors were encountered: