- Reference >
- Operators >
- Aggregation Pipeline Operators >
- Group Accumulator Operators >
- $avg (aggregation)
$avg (aggregation)¶
On this page
Definition¶
-
$avg
¶ Returns the average value of the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key.
$avg
ignores non-numeric values.$avg
is an accumulator operator available only in the$group
stage.$avg
has the following syntax:For more information on expressions, see Expressions.