inconsistent treatment of null in $project comparisons vs other stages

XMLWordPrintableJSON

    • Query Optimization
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      If a field is missing (undefined), in project stage it is impossible to determine that by comparing it to null.

       {$eq: ["$field", null] } 

      only returns true if 'field' is present and null.

      This is inconsistent with many other places, including ifNull treating null and undefined the same, as well as group (_id null and undefined all go into one bucket).

      If this is intentional then it should be documented.

      Tiny bit related to this is SERVER-6199

            Assignee:
            [DO NOT USE] Backlog - Query Optimization
            Reporter:
            Asya Kamsky
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: