$stats returns multiple basic metrics in one pass.
For the selected field, it computes:
countsumminmaxavg
$count, $sum, $min, $max, and $avg together, but returned as a single object.
Compatibility
| Field Type | Supported |
|---|---|
| TEXT | No |
| U64/I64/F64 | Yes |
| DATE | Yes |
| BOOL | Yes |
| KEYWORD | No |
| FACET | No |
FAST.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
field | string | Yes | Field to aggregate. |
missing | number | No | Fallback value for missing fields. |
- TypeScript
- Python
- Redis CLI
Output
min, max, and avg can be null when no values are available.