T - the operations result type.public class AggregateOperation<T> extends java.lang.Object implements AsyncReadOperation<AsyncBatchCursor<T>>, ReadOperation<BatchCursor<T>>
| 构造器和说明 |
|---|
AggregateOperation(MongoNamespace namespace,
java.util.List<BsonDocument> pipeline,
Decoder<T> decoder)
Construct a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
AggregateOperation<T> |
allowDiskUse(java.lang.Boolean allowDiskUse)
Enables writing to temporary files.
|
ReadOperation<BsonDocument> |
asExplainableOperation(ExplainVerbosity explainVerbosity)
Gets an operation whose execution explains this operation.
|
AsyncReadOperation<BsonDocument> |
asExplainableOperationAsync(ExplainVerbosity explainVerbosity)
Gets an operation whose execution explains this operation.
|
AggregateOperation<T> |
batchSize(java.lang.Integer batchSize)
Sets the number of documents to return per batch.
|
BatchCursor<T> |
execute(ReadBinding binding)
General execute which can return anything of type T
|
void |
executeAsync(AsyncReadBinding binding,
SingleResultCallback<AsyncBatchCursor<T>> callback)
General execute which can return anything of type T
|
java.lang.Boolean |
getAllowDiskUse()
Whether writing to temporary files is enabled.
|
java.lang.Integer |
getBatchSize()
Gets the number of documents to return per batch.
|
long |
getMaxTime(java.util.concurrent.TimeUnit timeUnit)
Gets the maximum execution time on the server for this operation.
|
java.util.List<BsonDocument> |
getPipeline()
Gets the aggregation pipeline.
|
ReadConcern |
getReadConcern()
Gets the read concern
|
java.lang.Boolean |
getUseCursor()
Gets whether the server should use a cursor to return results.
|
AggregateOperation<T> |
maxTime(long maxTime,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.
|
AggregateOperation<T> |
readConcern(ReadConcern readConcern)
Sets the read concern
|
AggregateOperation<T> |
useCursor(java.lang.Boolean useCursor)
Sets whether the server should use a cursor to return results.
|
public AggregateOperation(MongoNamespace namespace, java.util.List<BsonDocument> pipeline, Decoder<T> decoder)
namespace - the database and collection namespace for the operation.pipeline - the aggregation pipeline.decoder - the decoder for the result documents.public java.util.List<BsonDocument> getPipeline()
public java.lang.Boolean getAllowDiskUse()
public AggregateOperation<T> allowDiskUse(java.lang.Boolean allowDiskUse)
allowDiskUse - true if writing to temporary files is enabledpublic java.lang.Integer getBatchSize()
public AggregateOperation<T> batchSize(java.lang.Integer batchSize)
batchSize - the batch sizepublic long getMaxTime(java.util.concurrent.TimeUnit timeUnit)
timeUnit - the time unit to return the result inpublic AggregateOperation<T> maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
maxTime - the max timetimeUnit - the time unit, which may not be nullpublic java.lang.Boolean getUseCursor()
public AggregateOperation<T> useCursor(java.lang.Boolean useCursor)
useCursor - whether the server should use a cursor to return resultspublic ReadConcern getReadConcern()
public AggregateOperation<T> readConcern(ReadConcern readConcern)
readConcern - the read concernpublic BatchCursor<T> execute(ReadBinding binding)
ReadOperationexecute 在接口中 ReadOperation<BatchCursor<T>>binding - the binding to execute in the context ofpublic void executeAsync(AsyncReadBinding binding, SingleResultCallback<AsyncBatchCursor<T>> callback)
AsyncReadOperationexecuteAsync 在接口中 AsyncReadOperation<AsyncBatchCursor<T>>binding - the binding to execute in the context ofcallback - the callback to be called when the operation has been executedpublic ReadOperation<BsonDocument> asExplainableOperation(ExplainVerbosity explainVerbosity)
explainVerbosity - the explain verbositypublic AsyncReadOperation<BsonDocument> asExplainableOperationAsync(ExplainVerbosity explainVerbosity)
explainVerbosity - the explain verbosity