Package com.mongodb.operation
Class CountOperation
java.lang.Object
com.mongodb.operation.CountOperation
- All Implemented Interfaces:
AsyncReadOperation<Long>
,ReadOperation<Long>
@Deprecated
public class CountOperation
extends Object
implements AsyncReadOperation<Long>, ReadOperation<Long>
Deprecated.
An operation that executes a count.
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionCountOperation
(MongoNamespace namespace) Deprecated.Construct a new instance.CountOperation
(MongoNamespace namespace, com.mongodb.internal.client.model.CountStrategy countStrategy) Deprecated.Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionasExplainableOperation
(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 collation optionsexecute
(ReadBinding binding) Deprecated.General execute which can return anything of type Tvoid
executeAsync
(AsyncReadBinding binding, SingleResultCallback<Long> callback) Deprecated.General execute which can return anything of type Tfilter
(BsonDocument filter) Deprecated.Sets the filter to apply to the query.Deprecated.Returns the collation optionsDeprecated.Gets the query filter.getHint()
Deprecated.Gets the hint to apply.long
getLimit()
Deprecated.Gets the limit to apply.long
getMaxTime
(TimeUnit timeUnit) Deprecated.Gets the maximum execution time on the server for this operation.boolean
Deprecated.Gets the value for retryable reads.long
getSkip()
Deprecated.Gets the number of documents to skip.Deprecated.Sets the hint to apply.limit
(long limit) Deprecated.Sets the limit to apply.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.skip
(long skip) Deprecated.Sets the number of documents to skip.
-
Constructor Details
-
CountOperation
Deprecated.Construct a new instance.- Parameters:
namespace
- the database and collection namespace for the operation.
-
CountOperation
public CountOperation(MongoNamespace namespace, com.mongodb.internal.client.model.CountStrategy countStrategy) Deprecated.Construct a new instance.- Parameters:
namespace
- the database and collection namespace for the operation.countStrategy
- the strategy to use for calculating the count.
-
-
Method Details
-
getFilter
Deprecated.Gets the query filter.- Returns:
- the query filter
-
filter
Deprecated.Sets the filter to apply to the query.- Parameters:
filter
- the filter, which may be null.- Returns:
- this
-
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.Gets the hint to apply.- Returns:
- the hint, which should describe an existing
-
hint
Deprecated.Sets the hint to apply.- Parameters:
hint
- a value describing the index which should be used for this operation.- Returns:
- this
-
getLimit
public long getLimit()Deprecated.Gets the limit to apply. The default is 0, which means there is no limit.- Returns:
- the limit
-
limit
Deprecated.Sets the limit to apply.- Parameters:
limit
- the limit- Returns:
- this
-
getSkip
public long getSkip()Deprecated.Gets the number of documents to skip. The default is 0.- Returns:
- the number of documents to skip, which may be null
-
skip
Deprecated.Sets the number of documents to skip.- Parameters:
skip
- the number of documents to skip- 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
-
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
-
execute
Deprecated.Description copied from interface:ReadOperation
General execute which can return anything of type T- Specified by:
execute
in interfaceReadOperation<Long>
- Parameters:
binding
- the binding to execute in the context of- Returns:
- T, the result of the execution
-
executeAsync
Deprecated.Description copied from interface:AsyncReadOperation
General execute which can return anything of type T- Specified by:
executeAsync
in interfaceAsyncReadOperation<Long>
- 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
-