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

Fix ABT->SBE lowering of EvalFilter paths to correctly handle comparisons with arrays

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL

      When lowering PathTraverse within EvalFilter, it is sometimes necessary to execute the LambdaAbstraction against each element of the array and the whole array itself, rather than just the elements of the array.

      This approach is preferred to SERVER-62376 because we'd rather keep the ABT simple and allow the lowering code to inject the logic needed to handle these particular cases. See Fix ‘find({a: [1]})’ for ABT discussion for details.

      Here are some examples where ABT->SBE lowering currently does not produce correct results:

      • ‘find({a: [1]})’ should match both ‘{a: [1]}’ and ‘{a: [[1]]}’
      • ‘find({a: {$in: [[1],[2]]}})’ should match both ‘{a: [1]}’ and ‘{a: [[1]]}’
      • ‘find({a: {$type: “array”}})’ should match ‘{a: [1]}’ and ‘{a: [[1]]}’

      This issue could potentially affect the $exists operator as well.

      The goal of this task is to update ABT->SBE lowering so that it generates whatever is necessary to produce correct results for the cases listed above.

            Assignee:
            svilen.mihaylov@mongodb.com Svilen Mihaylov (Inactive)
            Reporter:
            hana.pearlman@mongodb.com Hana Pearlman
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: