$group stage accumulators

Accumulators, which can be used with the $group stage, include $avg (average), $sum (sum), $first, $last, $min (minimum), and $max (maximum). There are two which are used for standard deviation: $stdDevPop (population) and $stdDevSamp (sample). The $push operator produces an array of expression values for each group.

Get MongoDB 4 Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.