Bucket aggregations group matching documents into buckets. Use bucket aggregations when you want segmented analytics (for example by category, price tier, or time window).Documentation Index
Fetch the complete documentation index at: https://upstash-cloud-4245.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Available Operators
| Operator | What it groups by |
|---|---|
$terms | Distinct field values |
$range | Explicit from / to ranges |
$histogram | Fixed numeric intervals |
$dateHistogram | Fixed date/time intervals |
$facet | Hierarchical FACET paths |
Input Format
Every bucket operator takes an object with afield property and operator-specific parameters:
$terms — group by distinct values:
$range — custom range buckets:
$histogram — fixed numeric intervals:
$dateHistogram — fixed time intervals:
Behavior Notes
- Bucket operators can contain nested
$aggsfor per-bucket metrics. $terms,$range,$histogram, and$dateHistogramsupport nested$aggs.$facetdoes not support nested$aggsand cannot be used as a sub-aggregation.