Package com.mongodb.operation
Class CountOperation
- java.lang.Object
-
- com.mongodb.operation.CountOperation
-
- All Implemented Interfaces:
AsyncReadOperation<Long>,ReadOperation<Long>
Deprecated.
@Deprecated public class CountOperation extends Object implements AsyncReadOperation<Long>, ReadOperation<Long>
An operation that executes a count.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description CountOperation(MongoNamespace namespace)Deprecated.Construct a new instance.CountOperation(MongoNamespace namespace, com.mongodb.internal.client.model.CountStrategy countStrategy)Deprecated.Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ReadOperation<BsonDocument>asExplainableOperation(ExplainVerbosity explainVerbosity)Deprecated.Gets an operation whose execution explains this operation.AsyncReadOperation<BsonDocument>asExplainableOperationAsync(ExplainVerbosity explainVerbosity)Deprecated.Gets an operation whose execution explains this operation.CountOperationcollation(Collation collation)Deprecated.Sets the collation optionsLongexecute(ReadBinding binding)Deprecated.General execute which can return anything of type TvoidexecuteAsync(AsyncReadBinding binding, SingleResultCallback<Long> callback)Deprecated.General execute which can return anything of type TCountOperationfilter(BsonDocument filter)Deprecated.Sets the filter to apply to the query.CollationgetCollation()Deprecated.Returns the collation optionsBsonDocumentgetFilter()Deprecated.Gets the query filter.BsonValuegetHint()Deprecated.Gets the hint to apply.longgetLimit()Deprecated.Gets the limit to apply.longgetMaxTime(TimeUnit timeUnit)Deprecated.Gets the maximum execution time on the server for this operation.longgetSkip()Deprecated.Gets the number of documents to skip.CountOperationhint(BsonValue hint)Deprecated.Sets the hint to apply.CountOperationlimit(long limit)Deprecated.Sets the limit to apply.CountOperationmaxTime(long maxTime, TimeUnit timeUnit)Deprecated.Sets the maximum execution time on the server for this operation.CountOperationskip(long skip)Deprecated.Sets the number of documents to skip.
-
-
-
Constructor Detail
-
CountOperation
public CountOperation(MongoNamespace namespace)
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 Detail
-
getFilter
public BsonDocument getFilter()
Deprecated.Gets the query filter.- Returns:
- the query filter
- MongoDB documentation
- filter
-
filter
public CountOperation filter(BsonDocument filter)
Deprecated.Sets the filter to apply to the query.- Parameters:
filter- the filter, which may be null.- Returns:
- this
- MongoDB documentation
- Filter
-
getHint
public BsonValue getHint()
Deprecated.Gets the hint to apply.- Returns:
- the hint, which should describe an existing
-
hint
public CountOperation hint(BsonValue 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
- MongoDB documentation
- Limit
-
limit
public CountOperation limit(long limit)
Deprecated.Sets the limit to apply.- Parameters:
limit- the limit- Returns:
- this
- MongoDB documentation
- Limit
-
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
- MongoDB documentation
- Skip
-
skip
public CountOperation skip(long skip)
Deprecated.Sets the number of documents to skip.- Parameters:
skip- the number of documents to skip- Returns:
- this
- MongoDB documentation
- Skip
-
getMaxTime
public long getMaxTime(TimeUnit timeUnit)
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
public CountOperation maxTime(long maxTime, TimeUnit timeUnit)
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
public Collation getCollation()
Deprecated.Returns the collation options- Returns:
- the collation options
- Since:
- 3.4
- Since server release
- 3.4
-
collation
public CountOperation collation(Collation collation)
Deprecated.Sets the collation optionsA null value represents the server default.
- Parameters:
collation- the collation options to use- Returns:
- this
-
execute
public Long execute(ReadBinding binding)
Deprecated.Description copied from interface:ReadOperationGeneral execute which can return anything of type T- Specified by:
executein interfaceReadOperation<Long>- Parameters:
binding- the binding to execute in the context of- Returns:
- T, the result of the execution
-
executeAsync
public void executeAsync(AsyncReadBinding binding, SingleResultCallback<Long> callback)
Deprecated.Description copied from interface:AsyncReadOperationGeneral execute which can return anything of type T- Specified by:
executeAsyncin interfaceAsyncReadOperation<Long>- Parameters:
binding- the binding to execute in the context ofcallback- the callback to be called when the operation has been executed
-
asExplainableOperation
public ReadOperation<BsonDocument> asExplainableOperation(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
-
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
-
-