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

No index support for filtering on array fields inside $expr operator

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.4
    • Component/s: Aggregation Framework
    • None
    • ALL

      I have a collection containing the following documents:

      The index below is defined:

      I'm testing an aggregation with a single $match stage:

      It returns the second document as expected, but without index support:

      I discovered this strange behavior when testing a $lookup stage with an internal pipeline, where $expr operator is a must.

      BTW - I'm aware of this issue. I have tested non-array fields and indeed indexes are used for them.

        1. image-2018-07-24-17-23-28-706.png
          image-2018-07-24-17-23-28-706.png
          12 kB
        2. image-2018-07-24-17-22-03-862.png
          image-2018-07-24-17-22-03-862.png
          8 kB
        3. image-2018-07-24-17-13-14-601.png
          image-2018-07-24-17-13-14-601.png
          2 kB
        4. image-2018-07-24-17-12-31-999.png
          image-2018-07-24-17-12-31-999.png
          16 kB

            Assignee:
            nick.brewer Nick Brewer
            Reporter:
            cbartosiak Cezary Bartosiak
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: