Details
-
Improvement
-
Resolution: Won't Fix
-
Minor - P4
-
None
-
None
-
None
-
Query
Description
I am the original reporter that led to https://jira.mongodb.org/browse/DOCS-8996
I believe that $sum should work this way as well.
For example:
db.some_collection.aggregate([{$group: {
|
_id: null,
|
average: {$avg: '$bad_field'},
|
sum: {$sum: '$bad_field'},
|
}}]);
|
will return null for average, and 0 for sum. It should return null for sum.
I'm a little surprised $sum was not updated when $avg was, and feel that this was an oversight.
Thanks
Ben
Attachments
Issue Links
- related to
-
SERVER-14691 $avg aggregation operator should return null instead of 0
-
- Closed
-