Package com.mongodb.operation
Class AggregateOperation<T>
java.lang.Object
com.mongodb.operation.AggregateOperation<T>
- Type Parameters:
T
- the operations result type.
- All Implemented Interfaces:
AsyncReadOperation<AsyncBatchCursor<T>>
,ReadOperation<BatchCursor<T>>
@Deprecated
public class AggregateOperation<T>
extends Object
implements AsyncReadOperation<AsyncBatchCursor<T>>, ReadOperation<BatchCursor<T>>
Deprecated.
An operation that executes an aggregation query.
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionAggregateOperation
(MongoNamespace namespace, List<BsonDocument> pipeline, Decoder<T> decoder) Deprecated.Construct a new instance.AggregateOperation
(MongoNamespace namespace, List<BsonDocument> pipeline, Decoder<T> decoder, AggregationLevel aggregationLevel) Deprecated.Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionallowDiskUse
(Boolean allowDiskUse) Deprecated.Enables writing to temporary files.asExplainableOperation
(ExplainVerbosity explainVerbosity) Deprecated.Gets an operation whose execution explains this operation.asExplainableOperationAsync
(ExplainVerbosity explainVerbosity) Deprecated.Gets an operation whose execution explains this operation.Deprecated.Sets the number of documents to return per batch.Deprecated.Sets the collation optionsDeprecated.Sets the comment to the aggregation.execute
(ReadBinding binding) Deprecated.General execute which can return anything of type Tvoid
executeAsync
(AsyncReadBinding binding, SingleResultCallback<AsyncBatchCursor<T>> callback) Deprecated.General execute which can return anything of type TDeprecated.Whether writing to temporary files is enabled.Deprecated.Gets the number of documents to return per batch.Deprecated.Returns the collation optionsDeprecated.Returns the comment to send with the aggregate.getHint()
Deprecated.Returns the hint for which index to use.Deprecated.Returns the hint BsonValue for which index to use.long
getMaxAwaitTime
(TimeUnit timeUnit) Deprecated.The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query.long
getMaxTime
(TimeUnit timeUnit) Deprecated.Gets the maximum execution time on the server for this operation.Deprecated.Gets the aggregation pipeline.boolean
Deprecated.Gets the value for retryable reads.Deprecated.There is no replacement for this.Deprecated.Sets the hint for which index to use.maxAwaitTime
(long maxAwaitTime, TimeUnit timeUnit) Deprecated.Sets the maximum await execution time on the server for this operation.Deprecated.Sets the maximum execution time on the server for this operation.retryReads
(boolean retryReads) Deprecated.Enables retryable reads if a read fails due to a network error.toString()
Deprecated.Deprecated.There is no replacement for this.
-
Constructor Details
-
AggregateOperation
public AggregateOperation(MongoNamespace namespace, List<BsonDocument> pipeline, Decoder<T> decoder) Deprecated.Construct a new instance.- Parameters:
namespace
- the database and collection namespace for the operation.pipeline
- the aggregation pipeline.decoder
- the decoder for the result documents.
-
AggregateOperation
public AggregateOperation(MongoNamespace namespace, List<BsonDocument> pipeline, Decoder<T> decoder, AggregationLevel aggregationLevel) Deprecated.Construct a new instance.- Parameters:
namespace
- the database and collection namespace for the operation.pipeline
- the aggregation pipeline.decoder
- the decoder for the result documents.aggregationLevel
- the aggregation level- Since:
- 3.10
-
-
Method Details
-
getPipeline
Deprecated.Gets the aggregation pipeline.- Returns:
- the pipeline
-
getAllowDiskUse
Deprecated.Whether writing to temporary files is enabled. A null value indicates that it's unspecified.- Returns:
- true if writing to temporary files is enabled
-
allowDiskUse
Deprecated.Enables writing to temporary files. A null value indicates that it's unspecified.- Parameters:
allowDiskUse
- true if writing to temporary files is enabled- Returns:
- this
-
getBatchSize
Deprecated.Gets the number of documents to return per batch. Default to 0, which indicates that the server chooses an appropriate batch size.- Returns:
- the batch size, which may be null
-
batchSize
Deprecated.Sets the number of documents to return per batch.- Parameters:
batchSize
- the batch size- Returns:
- this
-
getMaxAwaitTime
Deprecated.The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. This only applies to a TAILABLE_AWAIT cursor. When the cursor is not a TAILABLE_AWAIT cursor, this option is ignored. A zero value will be ignored.- Parameters:
timeUnit
- the time unit to return the result in- Returns:
- the maximum await execution time in the given time unit
-
maxAwaitTime
Deprecated.Sets the maximum await execution time on the server for this operation.- Parameters:
maxAwaitTime
- the max await time. A value less than one will be ignored, and indicates that the driver should respect the server's default valuetimeUnit
- the time unit, which may not be null- Returns:
- this
-
getMaxTime
Deprecated.Gets the maximum execution time on the server for this operation. The default is 0, which places no limit on the execution time.- Parameters:
timeUnit
- the time unit to return the result in- Returns:
- the maximum execution time in the given time unit
-
maxTime
Deprecated.Sets the maximum execution time on the server for this operation.- Parameters:
maxTime
- the max timetimeUnit
- the time unit, which may not be null- Returns:
- this
-
getUseCursor
Deprecated.There is no replacement for this. Applications can assume that the driver will use a cursor for server versions that support it (>= 2.6). The driver will ignore this as of MongoDB 3.6, which does not support inline results for the aggregate command.Gets whether the server should use a cursor to return results. The default value is null, in which case a cursor will be used if the server supports it.- Returns:
- whether the server should use a cursor to return results
-
useCursor
Deprecated.There is no replacement for this. Applications can assume that the driver will use a cursor for server versions that support it (>= 2.6). The driver will ignore this as of MongoDB 3.6, which does not support inline results for the aggregate command.Sets whether the server should use a cursor to return results.- Parameters:
useCursor
- whether the server should use a cursor to return results- Returns:
- this
-
getCollation
Deprecated.Returns the collation options- Returns:
- the collation options
- Since:
- 3.4
-
collation
Deprecated.Sets the collation optionsA null value represents the server default.
- Parameters:
collation
- the collation options to use- Returns:
- this
- Since:
- 3.4
-
getComment
Deprecated.Returns the comment to send with the aggregate. The default is not to include a comment with the aggregation.- Returns:
- the comment
- Since:
- 3.6
-
comment
Deprecated.Sets the comment to the aggregation. A null value means no comment is set.- Parameters:
comment
- the comment- Returns:
- this
- Since:
- 3.6
-
retryReads
Deprecated.Enables retryable reads if a read fails due to a network error.- Parameters:
retryReads
- true if reads should be retried- Returns:
- this
- Since:
- 3.11
-
getRetryReads
public boolean getRetryReads()Deprecated.Gets the value for retryable reads. The default is true.- Returns:
- the retryable reads value
- Since:
- 3.11
-
getHint
Deprecated.Returns the hint for which index to use. The default is not to set a hint.- Returns:
- the hint
- Since:
- 3.6
-
getHintBsonValue
Deprecated.Returns the hint BsonValue for which index to use. The default is not to set a hint.Hints can either be a BsonString or a BsonDocument.
- Returns:
- the hint
- Since:
- 3.8
-
hint
Deprecated.Sets the hint for which index to use. A null value means no hint is set.- Parameters:
hint
- the hint- Returns:
- this
- Since:
- 3.6
-
execute
Deprecated.Description copied from interface:ReadOperation
General execute which can return anything of type T- Specified by:
execute
in interfaceReadOperation<T>
- Parameters:
binding
- the binding to execute in the context of- Returns:
- T, the result of the execution
-
executeAsync
public void executeAsync(AsyncReadBinding binding, SingleResultCallback<AsyncBatchCursor<T>> callback) Deprecated.Description copied from interface:AsyncReadOperation
General execute which can return anything of type T- Specified by:
executeAsync
in interfaceAsyncReadOperation<T>
- Parameters:
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed
-
asExplainableOperation
Deprecated.Gets an operation whose execution explains this operation.- Parameters:
explainVerbosity
- the explain verbosity- Returns:
- a read operation that when executed will explain this operation
-
asExplainableOperationAsync
public AsyncReadOperation<BsonDocument> asExplainableOperationAsync(ExplainVerbosity explainVerbosity) Deprecated.Gets an operation whose execution explains this operation.- Parameters:
explainVerbosity
- the explain verbosity- Returns:
- a read operation that when executed will explain this operation
-
toString
Deprecated.
-