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

$count aggregation stage does return nothing when count is zero

    • Query Optimization

      I was using the aggregation stage $count and noticed that if the input dataset was empty that $count does not return anything.

      I was expecting it to return 0.

      There is nothing specified in the docs to expect this behaviour.
      https://www.mongodb.com/docs/manual/reference/operator/aggregation/count/

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            daniel.mueller@surnet.ch Daniel Müller
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: