Q25: What are $facet and $bucket stages used for?
$facet: Executes multiple aggregation sub-pipelines concurrently within a single stage on the same input documents (useful for multi-faceted search and dashboard filtering).$bucket: Categorizes incoming documents into groups (buckets) based on specified boundaries and criteria.
Key Takeaways
$facetpowers multi-faceted search breakdowns in a single query.$bucketcategorizes numbers into defined numerical range groups.
Knowledge Check
Which stage allows running parallel aggregation pipelines to compute search results and category totals in one query pass?