java.lang.Object
org.springframework.data.mongodb.core.aggregation.FacetOperation
All Implemented Interfaces:
AggregationOperation, FieldsExposingAggregationOperation

public class FacetOperation extends Object implements FieldsExposingAggregationOperation
Encapsulates the aggregation framework $facet-operation.
Facet of AggregationOperations to be used in an Aggregation. Processes multiple AggregationOperation pipelines within a single stage on the same set of input documents. Each sub-pipeline has its own field in the output document where its results are stored as an array of documents. FacetOperation enables various aggregations on the same set of input documents, without needing to retrieve the input documents multiple times.
As of MongoDB 3.4, FacetOperation cannot be used with nested pipelines containing GeoNearOperation, OutOperation and FacetOperation.
We recommend to use the static factory method Aggregation.facet() instead of creating instances of this class directly.
Since:
1.10
Author:
Mark Paluch, Christoph Strobl
See Also: