The section “Aggregation Pipeline on a Sharded Cluster” indicates that the $facet pipeline stage will run on the primary shard.
When looking at the documentation:
There are references to $out and $lookup running on the primary shard but I don’t see $facet.
Can you clarify if $facet does run on the primary shard? Thank you!