Confused about $facet documentation and what is allowed

I am confused by the documentation on $facet.

Specifically, in the Behavior section, it isn’t clear to me if the prohibited aggregation stages are not allowed inside a $facet stage or in conjunction with the $facet stage? Or, both within the $facet stage and as a separate stage either before or after the $facet?

Can someone clear that up for me, please?

I think

All except the $out , $merge , and $geoNear stages can appear multiple times in a pipeline.

from the Aggregation Pipeline documentation page, combined with the $facet documentation, answers my question.

That answer being that the prohibition is for within the $facet stage.

@Tim_Rohrer , You are right!!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.