-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
Query Optimization
It would be nice to have syntactic sugar for the following stage which I type all the time:
{$group:{_id:"$field", count:{$sum:1}}}
Something like {$countBy:"$field"} would be more readable and be analogous to $count and $sortByCount stages (and would use same field names as sortByCount - i.e. count field for sum)