public class SortOperation extends Object implements AggregationOperation
$sort-operation.
We recommend to use the static factory method Aggregation#sort(Direction, String...) instead of creating
instances of this class directly.
| Constructor and Description |
|---|
SortOperation(Sort sort)
Creates a new
SortOperation for the given Sort instance. |
| Modifier and Type | Method and Description |
|---|---|
SortOperation |
and(Sort.Direction direction,
String... fields) |
SortOperation |
and(Sort sort) |
String |
getOperator()
Return the MongoDB operator that is used for this
AggregationOperation. |
org.bson.Document |
toDocument(AggregationOperationContext context)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoPipelineStagespublic SortOperation(Sort sort)
SortOperation for the given Sort instance.sort - must not be null.public SortOperation and(Sort.Direction direction, String... fields)
public SortOperation and(Sort sort)
public org.bson.Document toDocument(AggregationOperationContext context)
AggregationOperationtoDocument in interface AggregationOperationcontext - the AggregationOperationContext to operate within. Must not be null.public String getOperator()
AggregationOperationAggregationOperation. Aggregation operations should
implement this method to avoid document rendering.getOperator in interface AggregationOperationAggregationOperation.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.