Query Optimizer should check for exist: False & field: null when converting null binary operators

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: django
    • None
    • 🔵 Done
    • Python Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      • We recently released the QueryOptimizer, which converts $expr binary operators to their direct $match equivalents. However, there exists subtle differences between $expr binary operators and $match binary operators. Handling of null values (e.g. {"field": null} vs {"$expr": { "$eq" : ["field", null]}}) differ because in find() operations null can also mean the "lack of a fields existence" whereas in $expr it means the field must also exist.
      • As a consequence, to convert from express binary operator to a match operator, we need to include `$exists: False` in our operations.

      Acceptance Criteria

      • Have our optimizer code convert $expr on null matches to include $exists: false to ensure the query logic remains the same

      Pitfalls

      • Will require creating/rewriting test cases

            Assignee:
            Jib Adegunloye
            Reporter:
            Jib Adegunloye
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: