[CQF] reverseComparisonOp negates when it should flip

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • Fully Compatible
    • QO 2022-12-26
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      With forceBonsai enabled:

      > db.c.find()
      { "_id" : ObjectId("6377f2f520fd1e38034e8012"), "a" : 1 }
      { "_id" : ObjectId("6377f2f720fd1e38034e8014"), "a" : 2 }
      { "_id" : ObjectId("6377f2f920fd1e38034e8016"), "a" : 3 }
      > db.c.find({$expr: {$lt: [2, "$a"]}})
      { "_id" : ObjectId("6377f2f720fd1e38034e8014"), "a" : 2 }
      { "_id" : ObjectId("6377f2f920fd1e38034e8016"), "a" : 3 }
      

      The problem is `reverseComparisonOp` is supposed to flip the argument order (Lt to Gt), but it converts Lt to Gte instead. Possibly we were confusing "flip argument order" with "negate boolean result".

            Assignee:
            Will Buerger
            Reporter:
            David Percy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: