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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Query Execution
    • ALL

    Description

      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.

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            arun.banala@mongodb.com Arun Banala
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: