public class AggregateToCollectionOperation extends Object implements AsyncWriteOperation<Void>, WriteOperation<Void>
| Constructor and Description |
|---|
AggregateToCollectionOperation(MongoNamespace namespace,
List<BsonDocument> pipeline)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
AggregateToCollectionOperation |
allowDiskUse(Boolean allowDiskUse)
Enables writing to temporary files.
|
Void |
execute(WriteBinding binding)
General execute which can return anything of type T
|
void |
executeAsync(AsyncWriteBinding binding,
SingleResultCallback<Void> callback)
General execute which can return anything of type T
|
Boolean |
getAllowDiskUse()
Whether writing to temporary files is enabled.
|
long |
getMaxTime(TimeUnit timeUnit)
Gets the maximum execution time on the server for this operation.
|
List<BsonDocument> |
getPipeline()
Gets the aggregation pipeline.
|
AggregateToCollectionOperation |
maxTime(long maxTime,
TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.
|
public AggregateToCollectionOperation(MongoNamespace namespace, List<BsonDocument> pipeline)
namespace - the database and collection namespace for the operation.pipeline - the aggregation pipeline.public List<BsonDocument> getPipeline()
public Boolean getAllowDiskUse()
public AggregateToCollectionOperation allowDiskUse(Boolean allowDiskUse)
allowDiskUse - true if writing to temporary files is enabledpublic long getMaxTime(TimeUnit timeUnit)
timeUnit - the time unit to return the result inpublic AggregateToCollectionOperation maxTime(long maxTime, TimeUnit timeUnit)
maxTime - the max timetimeUnit - the time unit, which may not be nullpublic Void execute(WriteBinding binding)
WriteOperationexecute in interface WriteOperation<Void>binding - the binding to execute in the context ofpublic void executeAsync(AsyncWriteBinding binding, SingleResultCallback<Void> callback)
AsyncWriteOperationexecuteAsync in interface AsyncWriteOperation<Void>binding - the binding to execute in the context ofcallback - the callback to be called when the operation has been executed