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

Fix ABT Translation for comparing GTE and LTE null

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • QO 2022-07-25, QO 2022-08-22, QO 2022-09-05, QO 2022-09-19

      Currently in Bonsai if you compare if you do a find(a: {$gte: null} ) query, documents without the "a" field are incorrectly missing from the results.

      Ex. find( a: {$gte: null} )

      actual=[ { "_id" : 1, "a" : null } ],expected=[ { "_id" : 1, "a" : null }, { "_id" : 2, "b" : "" } ]
      

      The issue lies in generateSimpleComparison. The solution likely is in the cases for Operations::Lte and Operations::Gte, where a PathDefault node must be included for the null case. 
      Note that this is already done for Operations:Eq in generateSimpleComparison, but must be added for Lte and Gte.

      The exact same problem exists for Minkey/MaxKey. If you do find(a: {$lte: MaxKey()} ) documents without the "a" field are incorrectly missing from the results. The bugfix for minkey and maxkey should be the exact same as the null case.

      Ex. find( a: {$lte: MaxKey()} )

      actual=[ { "_id" : 1, "a" : null } ],expected=[ { "_id" : 1, "a" : null }, { "_id" : 2, "b" : "" } ]
      

       

            Assignee:
            militsa.sotirova@mongodb.com Militsa Sotirova
            Reporter:
            emily.wang@mongodb.com Emily Wang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: