filter.
Use metrics when you want one value (or stats object), not grouped buckets.
Available Operators
| Operator | What it computes |
|---|---|
$avg | Arithmetic mean |
$sum | Total of values |
$min | Smallest value |
$max | Largest value |
$count | Count of values |
$cardinality | Count of distinct values |
$stats | count, sum, min, max, avg |
$extendedStats | $stats + variance and std deviation metrics |
$percentiles | Distribution percent points |
Input Format
Every metric operator takes an object with at least afield property:
field value must be a string pointing to a FAST field in your schema.
Do not pass a bare string — it must be an object with {"field": "..."}.
Behavior Notes
- Metric operators require a
field— you will getmissing required 'field' propertyif it’s omitted. - The field must be
FASTin your schema — otherwise you will get an error:operator '$avg' requires field '<field>' to be FAST. See FAST Fields. - Metric operators do not support nested
$aggs. - For many metric operators,
missinglets you provide a fallback value for documents where the field does not exist.