Module spring.data.mongodb
Class MatchOperation
java.lang.Object
org.springframework.data.mongodb.core.aggregation.MatchOperation
- All Implemented Interfaces:
AggregationOperation
Encapsulates the
$match-operation.
We recommend to use the static factory method
Aggregation.match(org.springframework.data.mongodb.core.query.Criteria) instead of creating instances of this
class directly.
- Since:
- 1.3
- Author:
- Sebastian Herold, Thomas Darimont, Oliver Gierke, Divya Srivastava
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMatchOperation(AggregationExpression expression) Creates a newMatchOperationfor the givenAggregationExpression.MatchOperation(CriteriaDefinition criteriaDefinition) Creates a newMatchOperationfor the givenCriteriaDefinition. -
Method Summary
Modifier and TypeMethodDescriptionReturn the MongoDB operator that is used for thisAggregationOperation.org.bson.DocumenttoDocument(AggregationOperationContext context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.mongodb.core.aggregation.AggregationOperation
toPipelineStages
-
Constructor Details
-
MatchOperation
Creates a newMatchOperationfor the givenCriteriaDefinition.- Parameters:
criteriaDefinition- must not be null.
-
MatchOperation
Creates a newMatchOperationfor the givenAggregationExpression.- Parameters:
expression- must not be null.- Since:
- 3.3
-
-
Method Details
-
toDocument
Description copied from interface:AggregationOperation- Specified by:
toDocumentin interfaceAggregationOperation- Parameters:
context- theAggregationOperationContextto operate within. Must not be null.- Returns:
- the Document
-
getOperator
Description copied from interface:AggregationOperationReturn the MongoDB operator that is used for thisAggregationOperation. Aggregation operations should implement this method to avoid document rendering.- Specified by:
getOperatorin interfaceAggregationOperation- Returns:
- the operator used for this
AggregationOperation.
-