[SERVER-49513] Consider exposing matching value for operators like $nin in doc validation error details Created: 15/Jul/20 Updated: 06/Dec/22 Resolved: 03/Sep/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Mihai Andrei | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | qexec-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query
|
| Participants: |
| Description |
|
Consider the validator expression {"a.b": {"$nin": [1, [2, 3, 4]]}} and the document {"a": [{"b": [1, 2]}, {"b": [3, 4]}]. This document will fail validation because the value '1' is present within {"b": [1, 2]}, but the generated error will report 'consideredValues: [1, 2, [1,2], 3, 4, [3,4]]' without specifying which of the considered values was found to be matching. Consider adding support for exposing matching values in the case of negation expressions like $nin where, because the operator has multiple arguments, it's not immediately obvious which of the values matched. |