Package dev.morphia.query
Class CountOptions
- java.lang.Object
-
- com.mongodb.client.model.CountOptions
-
- dev.morphia.query.CountOptions
-
- All Implemented Interfaces:
SessionConfigurable<CountOptions>
public class CountOptions extends com.mongodb.client.model.CountOptions implements SessionConfigurable<CountOptions>
The options for a count operation.- Since:
- 1.3
-
-
Constructor Summary
Constructors Constructor Description CountOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.mongodb.client.ClientSession
clientSession()
The client session to use for the insertion.CountOptions
clientSession(com.mongodb.client.ClientSession clientSession)
Set the client session to use for the insert.CountOptions
collation(com.mongodb.client.model.Collation collation)
long
getMaxTime(TimeUnit timeUnit)
CountOptions
hint(String hint)
Defines the index hint valueCountOptions
hint(org.bson.conversions.Bson hint)
CountOptions
hint(org.bson.Document hint)
Defines the index hint valueCountOptions
hintString(String hint)
CountOptions
limit(int limit)
CountOptions
maxTime(long maxTime, TimeUnit timeUnit)
com.mongodb.ReadConcern
readConcern()
Returns the readConcernCountOptions
readConcern(com.mongodb.ReadConcern readConcern)
Sets the readConcerncom.mongodb.ReadPreference
readPreference()
Returns the readPreferenceCountOptions
readPreference(com.mongodb.ReadPreference readPreference)
Sets the readPreferenceCountOptions
skip(int skip)
-
-
-
Method Detail
-
clientSession
public CountOptions clientSession(com.mongodb.client.ClientSession clientSession)
Description copied from interface:SessionConfigurable
Set the client session to use for the insert.- Specified by:
clientSession
in interfaceSessionConfigurable<CountOptions>
- Parameters:
clientSession
- the client session- Returns:
- this
-
clientSession
public com.mongodb.client.ClientSession clientSession()
Description copied from interface:SessionConfigurable
The client session to use for the insertion.- Specified by:
clientSession
in interfaceSessionConfigurable<CountOptions>
- Returns:
- the client session
-
hint
public CountOptions hint(String hint)
Defines the index hint value- Parameters:
hint
- the hint- Returns:
- this
-
hint
public CountOptions hint(org.bson.Document hint)
Defines the index hint value- Parameters:
hint
- the hint- Returns:
- this
-
hint
public CountOptions hint(@Nullable org.bson.conversions.Bson hint)
- Overrides:
hint
in classcom.mongodb.client.model.CountOptions
-
limit
public CountOptions limit(int limit)
- Overrides:
limit
in classcom.mongodb.client.model.CountOptions
-
hintString
public CountOptions hintString(@Nullable String hint)
- Overrides:
hintString
in classcom.mongodb.client.model.CountOptions
-
skip
public CountOptions skip(int skip)
- Overrides:
skip
in classcom.mongodb.client.model.CountOptions
-
getMaxTime
public long getMaxTime(TimeUnit timeUnit)
- Overrides:
getMaxTime
in classcom.mongodb.client.model.CountOptions
-
maxTime
public CountOptions maxTime(long maxTime, TimeUnit timeUnit)
- Overrides:
maxTime
in classcom.mongodb.client.model.CountOptions
-
collation
public CountOptions collation(@Nullable com.mongodb.client.model.Collation collation)
- Overrides:
collation
in classcom.mongodb.client.model.CountOptions
-
readConcern
public com.mongodb.ReadConcern readConcern()
Returns the readConcern- Returns:
- the readConcern
- Since server release
- 3.2
-
readConcern
public CountOptions readConcern(com.mongodb.ReadConcern readConcern)
Sets the readConcern- Parameters:
readConcern
- the readConcern- Returns:
- this
- Since server release
- 3.2
-
readPreference
public com.mongodb.ReadPreference readPreference()
Returns the readPreference- Returns:
- the readPreference
-
readPreference
public CountOptions readPreference(com.mongodb.ReadPreference readPreference)
Sets the readPreference- Parameters:
readPreference
- the readPreference- Returns:
- this
-
-