Package dev.morphia.query
Class CountOptions
- java.lang.Object
-
- com.mongodb.client.model.CountOptions
-
- dev.morphia.query.CountOptions
-
- All Implemented Interfaces:
dev.morphia.internal.CollectionConfigurable<CountOptions>,dev.morphia.internal.CollectionConfiguration,dev.morphia.internal.ReadConfigurable<CountOptions>
public class CountOptions extends com.mongodb.client.model.CountOptions implements dev.morphia.internal.CollectionConfigurable<CountOptions>, dev.morphia.internal.ReadConfigurable<CountOptions>
The options for a count operation.- Since:
- 1.3
-
-
Constructor Summary
Constructors Constructor Description CountOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CountOptionscollation(com.mongodb.client.model.Collation collation)Stringcollection()Returns the alternate collection to use for the operation.CountOptionscollection(String collection)Sets the alternate collection to use for the operation.CountOptionscomment(String comment)CountOptionscomment(org.bson.BsonValue comment)longgetMaxTime(TimeUnit timeUnit)Deprecated, for removal: This API element is subject to removal in a future version.CountOptionshint(String hint)Defines the index hint valueCountOptionshint(org.bson.conversions.Bson hint)CountOptionshint(org.bson.Document hint)Defines the index hint valueCountOptionshintString(String hint)CountOptionslimit(int limit)CountOptionsmaxTime(long maxTime, TimeUnit timeUnit)com.mongodb.ReadConcernreadConcern()Returns the readConcernCountOptionsreadConcern(com.mongodb.ReadConcern readConcern)Sets the readConcerncom.mongodb.ReadPreferencereadPreference()Returns the readPreferenceCountOptionsreadPreference(com.mongodb.ReadPreference readPreference)Sets the readPreferenceCountOptionsskip(int skip)-
Methods inherited from class com.mongodb.client.model.CountOptions
getCollation, getComment, getHint, getHintString, getLimit, getSkip, toString
-
-
-
-
Method Detail
-
collection
public CountOptions collection(String collection)
Description copied from interface:dev.morphia.internal.CollectionConfigurableSets the alternate collection to use for the operation.- Specified by:
collectionin interfacedev.morphia.internal.CollectionConfigurable<CountOptions>- Parameters:
collection- the name of the collection to use- Returns:
- this
-
collection
public String collection()
Description copied from interface:dev.morphia.internal.CollectionConfigurableReturns the alternate collection to use for the operation. Might return null.- Specified by:
collectionin interfacedev.morphia.internal.CollectionConfigurable<CountOptions>- Returns:
- the collection name or null
-
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:
hintin classcom.mongodb.client.model.CountOptions
-
hintString
public CountOptions hintString(@Nullable String hint)
- Overrides:
hintStringin classcom.mongodb.client.model.CountOptions
-
limit
public CountOptions limit(int limit)
- Overrides:
limitin classcom.mongodb.client.model.CountOptions
-
skip
public CountOptions skip(int skip)
- Overrides:
skipin classcom.mongodb.client.model.CountOptions
-
getMaxTime
@Deprecated(forRemoval=true, since="2.3") public long getMaxTime(TimeUnit timeUnit)
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
getMaxTimein classcom.mongodb.client.model.CountOptions
-
maxTime
public CountOptions maxTime(long maxTime, TimeUnit timeUnit)
- Overrides:
maxTimein classcom.mongodb.client.model.CountOptions
-
collation
public CountOptions collation(@Nullable com.mongodb.client.model.Collation collation)
- Overrides:
collationin classcom.mongodb.client.model.CountOptions
-
comment
public CountOptions comment(String comment)
- Overrides:
commentin classcom.mongodb.client.model.CountOptions- Returns:
- this
- Since:
- 2.3
-
comment
public CountOptions comment(org.bson.BsonValue comment)
- Overrides:
commentin classcom.mongodb.client.model.CountOptions- Returns:
- this
- Since:
- 2.3
-
readConcern
public com.mongodb.ReadConcern readConcern()
Returns the readConcern- Specified by:
readConcernin interfacedev.morphia.internal.ReadConfigurable<CountOptions>- Returns:
- the readConcern
- Since server release
- 3.2
-
readPreference
public com.mongodb.ReadPreference readPreference()
Returns the readPreference- Specified by:
readPreferencein interfacedev.morphia.internal.ReadConfigurable<CountOptions>- Returns:
- the readPreference
-
readConcern
public CountOptions readConcern(com.mongodb.ReadConcern readConcern)
Sets the readConcern- Specified by:
readConcernin interfacedev.morphia.internal.ReadConfigurable<CountOptions>- Parameters:
readConcern- the readConcern- Returns:
- this
- Since server release
- 3.2
-
readPreference
public CountOptions readPreference(com.mongodb.ReadPreference readPreference)
Sets the readPreference- Specified by:
readPreferencein interfacedev.morphia.internal.ReadConfigurable<CountOptions>- Parameters:
readPreference- the readPreference- Returns:
- this
-
-