Package com.mongodb.client.model
Class DBCollectionCountOptions
java.lang.Object
com.mongodb.client.model.DBCollectionCountOptions
The options for a count operation.
- Since:
- 3.4
- MongoDB documentation
- Count
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionSets the collationReturns the collation optionsgetHint()Gets the hint to apply.Gets the hint string to apply.intgetLimit()Gets the limit to apply.longgetMaxTime(TimeUnit timeUnit) Gets the maximum execution time on the server for this operation.Returns the readConcernReturns the readPreferenceintgetSkip()Gets the number of documents to skip.Sets the hint to apply.hintString(String hint) Sets the hint to apply.limit(int limit) Sets the limit to apply.limit(long limit) Sets the limit to apply.Sets the maximum execution time on the server for this operation.readConcern(ReadConcern readConcern) Sets the readConcernreadPreference(ReadPreference readPreference) Sets the readPreferenceskip(int skip) Sets the number of documents to skip.skip(long skip) Sets the number of documents to skip.
- 
Constructor Details- 
DBCollectionCountOptionspublic DBCollectionCountOptions()Construct a new instance
 
- 
- 
Method Details- 
getHintGets the hint to apply.- Returns:
- the hint, which should describe an existing
 
- 
getHintStringGets the hint string to apply.- Returns:
- the hint string, which should be the name of an existing index
 
- 
hintSets the hint to apply.- Parameters:
- hint- a document describing the index which should be used for this operation.
- Returns:
- this
 
- 
hintStringSets the hint to apply.- Parameters:
- hint- the name of the index which should be used for the operation
- Returns:
- this
 
- 
getLimitpublic int getLimit()Gets the limit to apply. The default is 0, which means there is no limit.- Returns:
- the limit
- MongoDB documentation
- Limit
 
- 
limitSets the limit to apply.- Parameters:
- limit- the limit
- Returns:
- this
- MongoDB documentation
- Limit
 
- 
getSkippublic int getSkip()Gets the number of documents to skip. The default is 0.- Returns:
- the number of documents to skip
- MongoDB documentation
- Skip
 
- 
skipSets the number of documents to skip.- Parameters:
- skip- the number of documents to skip
- Returns:
- this
- MongoDB documentation
- Skip
 
- 
limitSets the limit to apply.- Parameters:
- limit- the limit
- Returns:
- this
- MongoDB documentation
- Limit
 
- 
skipSets the number of documents to skip.- Parameters:
- skip- the number of documents to skip
- Returns:
- this
- MongoDB documentation
- Skip
 
- 
getMaxTimeGets 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
 
- 
maxTimeSets the maximum execution time on the server for this operation.- Parameters:
- maxTime- the max time
- timeUnit- the time unit, which may not be null
- Returns:
- this
 
- 
getReadPreferenceReturns the readPreference- Returns:
- the readPreference
 
- 
readPreferenceSets the readPreference- Parameters:
- readPreference- the readPreference
- Returns:
- this
 
- 
getReadConcernReturns the readConcern- Returns:
- the readConcern
- Since server release
- 3.2
 
- 
readConcernSets the readConcern- Parameters:
- readConcern- the readConcern
- Returns:
- this
- Since server release
- 3.2
 
- 
getCollationReturns the collation options- Returns:
- the collation options
- Since server release
- 3.4
 
- 
collationSets the collation- Parameters:
- collation- the collation
- Returns:
- this
- Since server release
- 3.4
 
 
-