Package com.mongodb.client.model
Class DBCollectionCountOptions
- java.lang.Object
-
- com.mongodb.client.model.DBCollectionCountOptions
-
-
Constructor Summary
Constructors Constructor Description DBCollectionCountOptions()Construct a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DBCollectionCountOptionscollation(Collation collation)Sets the collationCollationgetCollation()Returns the collation optionsDBObjectgetHint()Gets the hint to apply.StringgetHintString()Deprecated.PrefergetHint()intgetLimit()Gets the limit to apply.longgetMaxTime(TimeUnit timeUnit)Gets the maximum execution time on the server for this operation.ReadConcerngetReadConcern()Returns the readConcernReadPreferencegetReadPreference()Returns the readPreferenceintgetSkip()Gets the number of documents to skip.DBCollectionCountOptionshint(DBObject hint)Sets the hint to apply.DBCollectionCountOptionshintString(String hint)Deprecated.Preferhint(DBObject)DBCollectionCountOptionslimit(int limit)Sets the limit to apply.DBCollectionCountOptionslimit(long limit)Sets the limit to apply.DBCollectionCountOptionsmaxTime(long maxTime, TimeUnit timeUnit)Sets the maximum execution time on the server for this operation.DBCollectionCountOptionsreadConcern(ReadConcern readConcern)Sets the readConcernDBCollectionCountOptionsreadPreference(ReadPreference readPreference)Sets the readPreferenceDBCollectionCountOptionsskip(int skip)Sets the number of documents to skip.DBCollectionCountOptionsskip(long skip)Sets the number of documents to skip.
-
-
-
Method Detail
-
getHint
@Nullable public DBObject getHint()
Gets the hint to apply.- Returns:
- the hint, which should describe an existing
-
getHintString
@Deprecated @Nullable public String getHintString()
Deprecated. PrefergetHint()Gets the hint string to apply.- Returns:
- the hint string, which should be the name of an existing index
-
hint
public DBCollectionCountOptions hint(@Nullable DBObject hint)
Sets the hint to apply.- Parameters:
hint- a document describing the index which should be used for this operation.- Returns:
- this
-
hintString
@Deprecated public DBCollectionCountOptions hintString(@Nullable String hint)
Deprecated. Preferhint(DBObject)Sets the hint to apply.- Parameters:
hint- the name of the index which should be used for the operation- Returns:
- this
-
getLimit
public int getLimit()
Gets the limit to apply. The default is 0, which means there is no limit.- Returns:
- the limit
- MongoDB documentation
- Limit
-
limit
public DBCollectionCountOptions limit(int limit)
Sets the limit to apply.- Parameters:
limit- the limit- Returns:
- this
- MongoDB documentation
- Limit
-
getSkip
public int getSkip()
Gets the number of documents to skip. The default is 0.- Returns:
- the number of documents to skip
- MongoDB documentation
- Skip
-
skip
public DBCollectionCountOptions skip(int skip)
Sets the number of documents to skip.- Parameters:
skip- the number of documents to skip- Returns:
- this
- MongoDB documentation
- Skip
-
limit
public DBCollectionCountOptions limit(long limit)
Sets the limit to apply.- Parameters:
limit- the limit- Returns:
- this
- MongoDB documentation
- Limit
-
skip
public DBCollectionCountOptions skip(long skip)
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)
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 DBCollectionCountOptions maxTime(long maxTime, TimeUnit timeUnit)
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
-
getReadPreference
@Nullable public ReadPreference getReadPreference()
Returns the readPreference- Returns:
- the readPreference
-
readPreference
public DBCollectionCountOptions readPreference(@Nullable ReadPreference readPreference)
Sets the readPreference- Parameters:
readPreference- the readPreference- Returns:
- this
-
getReadConcern
@Nullable public ReadConcern getReadConcern()
Returns the readConcern- Returns:
- the readConcern
- Since server release
- 3.2
-
readConcern
public DBCollectionCountOptions readConcern(@Nullable ReadConcern readConcern)
Sets the readConcern- Parameters:
readConcern- the readConcern- Returns:
- this
- Since server release
- 3.2
-
getCollation
@Nullable public Collation getCollation()
Returns the collation options- Returns:
- the collation options
- Since server release
- 3.4
-
collation
public DBCollectionCountOptions collation(@Nullable Collation collation)
Sets the collation- Parameters:
collation- the collation- Returns:
- this
- Since server release
- 3.4
-
-