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

inconsistent treatment of null in $project comparisons vs other stages

    • Query Optimization
    • ALL

      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:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: