Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-49513

Consider exposing matching value for operators like $nin in doc validation error details

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Query

      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.

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            mihai.andrei@mongodb.com Mihai Andrei
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: