Module spring.data.mongodb
Class SortOperation
java.lang.Object
org.springframework.data.mongodb.core.aggregation.SortOperation
- All Implemented Interfaces:
AggregationOperation
Encapsulates the aggregation framework
$sort-operation.
We recommend to use the static factory method Aggregation.sort(Direction, String...) instead of creating
instances of this class directly.
- Since:
- 1.3
- Author:
- Thomas Darimont, Oliver Gierke, Christoph Strobl, Mark Paluch
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSortOperation(Sort sort) Creates a newSortOperationfor the givenSortinstance. -
Method Summary
Modifier and TypeMethodDescriptionand(Sort.Direction direction, String... fields) Return 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
-
SortOperation
Creates a newSortOperationfor the givenSortinstance.- Parameters:
sort- must not be null.
-
-
Method Details
-
and
-
and
-
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.
-