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

[CQF] Conjunction with predicates over the same field does not match documents where the field is an array

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • QE 2022-07-11

    Description

      Although it looks like a contradiction at a glance, the query

      {$and: [{a: 1}, {a: 2}]}
      

      Matches the document

      {a: [1, 2]}

      as each predicate is applied after implicitly traversing the leaf array. This query works on classic but does not return the matching document with Bonsai enabled.

      The relevant test is here ($all is sugar for $and).

      Attachments

        Activity

          People

            svilen.mihaylov@mongodb.com Svilen Mihaylov (Inactive)
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: