Concept Flow - $bucket and $bucketAuto for distribution
Start with data array
$bucket or $bucketAuto stage
Define boundaries or bucket count
Group data into buckets
Count documents per bucket
Output buckets with counts
Data flows into a bucket stage where it is grouped into ranges or automatic buckets, then counts per bucket are output.