Skip to main content
$avg computes the arithmetic mean of a field across matching documents. If missing is provided, documents without the field are treated as if they had the missing value.

Compatibility

Field must be FAST.

Arguments

Output

value is null when no values are available after filtering.