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

$elemMatch should check for strict object type when matching sub-object

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Execution
    • ALL

      The code in ElemMatchObjectMatchExpression::matchesArray() is not checking for strict object type for sub-objects. This means the _sub match expression could incorrectly be applied on a sub-array and match wrong documents in some cases. We should change the above condition to inner.type() == Object instead.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            arun.banala@mongodb.com Arun Banala
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: