AsyncWriteOperation<Void>
, WriteOperation<Void>
public class AggregateToCollectionOperation extends Object implements AsyncWriteOperation<Void>, WriteOperation<Void>
Constructor | Description |
---|---|
AggregateToCollectionOperation(MongoNamespace namespace,
List<BsonDocument> pipeline) |
Deprecated.
|
AggregateToCollectionOperation(MongoNamespace namespace,
List<BsonDocument> pipeline,
WriteConcern writeConcern) |
Construct a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
AggregateToCollectionOperation |
allowDiskUse(Boolean allowDiskUse) |
Enables writing to temporary files.
|
ReadOperation<BsonDocument> |
asExplainableOperation(ExplainVerbosity explainVerbosity) |
Gets an operation whose execution explains this operation.
|
AggregateToCollectionOperation |
bypassDocumentValidation(Boolean bypassDocumentValidation) |
Sets the bypass document level validation flag.
|
AggregateToCollectionOperation |
collation(Collation collation) |
Sets the collation options
|
AggregateToCollectionOperation |
comment(String comment) |
Sets the comment to the aggregation.
|
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.
|
Boolean |
getBypassDocumentValidation() |
Gets the bypass document level validation flag
|
Collation |
getCollation() |
Returns the collation options
|
String |
getComment() |
Returns the comment to send with the aggregate.
|
BsonDocument |
getHint() |
Returns the hint for which index to use.
|
long |
getMaxTime(TimeUnit timeUnit) |
Gets the maximum execution time on the server for this operation.
|
List<BsonDocument> |
getPipeline() |
Gets the aggregation pipeline.
|
WriteConcern |
getWriteConcern() |
Gets the write concern.
|
AggregateToCollectionOperation |
hint(BsonDocument hint) |
Sets the hint for which index to use.
|
AggregateToCollectionOperation |
maxTime(long maxTime,
TimeUnit timeUnit) |
Sets the maximum execution time on the server for this operation.
|
@Deprecated public AggregateToCollectionOperation(MongoNamespace namespace, List<BsonDocument> pipeline)
AggregateToCollectionOperation(MongoNamespace, List, WriteConcern)
namespace
- the database and collection namespace for the operation.pipeline
- the aggregation pipeline.public AggregateToCollectionOperation(MongoNamespace namespace, List<BsonDocument> pipeline, WriteConcern writeConcern)
namespace
- the database and collection namespace for the operation.pipeline
- the aggregation pipeline.writeConcern
- the write concern to applypublic List<BsonDocument> getPipeline()
public WriteConcern getWriteConcern()
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 Boolean getBypassDocumentValidation()
public AggregateToCollectionOperation bypassDocumentValidation(Boolean bypassDocumentValidation)
Note: This only applies when an $out stage is specified
.bypassDocumentValidation
- If true, allows the write to opt-out of document level validation.public Collation getCollation()
public AggregateToCollectionOperation collation(Collation collation)
A null value represents the server default.
collation
- the collation options to usepublic String getComment()
public AggregateToCollectionOperation comment(String comment)
comment
- the commentpublic BsonDocument getHint()
public AggregateToCollectionOperation hint(BsonDocument hint)
hint
- the hintpublic ReadOperation<BsonDocument> asExplainableOperation(ExplainVerbosity explainVerbosity)
explainVerbosity
- the explain verbositypublic Void execute(WriteBinding binding)
WriteOperation
execute
in interface WriteOperation<Void>
binding
- the binding to execute in the context ofpublic void executeAsync(AsyncWriteBinding binding, SingleResultCallback<Void> callback)
AsyncWriteOperation
executeAsync
in interface AsyncWriteOperation<Void>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed