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

Add $isNull aggregation expression

    • Query Optimization

      We should add an $isNull aggregation expression, that returns true for missing, null, or undefined values.

      Original Description

      I have documents that sometimes have an array field called purchases and sometimes not and it fails when $size hits a document without the purchases field. I don't see how to check if it is an array before running it. $exists does not seem to work within $project nor $type to check if it is an array type. The easiest would be if $size just doesn't fail and returns null.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            matt.kalan@mongodb.com Matt Kalan
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: