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 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(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(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(Bson hint)CountOptionshint(Document hint)Defines the index hint valueCountOptionshintString(String hint)CountOptionslimit(int limit)CountOptionsmaxTime(long maxTime, TimeUnit timeUnit)ReadConcernreadConcern()Returns the readConcernCountOptionsreadConcern(ReadConcern readConcern)Sets the readConcernReadPreferencereadPreference()Returns the readPreferenceCountOptionsreadPreference(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(Document hint)
Defines the index hint value- Parameters:
 hint- the hint- Returns:
 - this
 
 
- 
hint
public CountOptions hint(@Nullable Bson hint)
- Overrides:
 hintin classCountOptions
 
- 
hintString
public CountOptions hintString(@Nullable String hint)
- Overrides:
 hintStringin classCountOptions
 
- 
limit
public CountOptions limit(int limit)
- Overrides:
 limitin classCountOptions
 
- 
skip
public CountOptions skip(int skip)
- Overrides:
 skipin classCountOptions
 
- 
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 classCountOptions
 
- 
maxTime
public CountOptions maxTime(long maxTime, TimeUnit timeUnit)
- Overrides:
 maxTimein classCountOptions
 
- 
collation
public CountOptions collation(@Nullable Collation collation)
- Overrides:
 collationin classCountOptions
 
- 
comment
public CountOptions comment(String comment)
- Overrides:
 commentin classCountOptions- Returns:
 - this
 - Since:
 - 2.3
 
 
- 
comment
public CountOptions comment(BsonValue comment)
- Overrides:
 commentin classCountOptions- Returns:
 - this
 - Since:
 - 2.3
 
 
- 
readConcern
public ReadConcern readConcern()
Returns the readConcern- Specified by:
 readConcernin interfacedev.morphia.internal.ReadConfigurable<CountOptions>- Returns:
 - the readConcern
 - Since server release
 - 3.2
 
 
- 
readPreference
public ReadPreference readPreference()
Returns the readPreference- Specified by:
 readPreferencein interfacedev.morphia.internal.ReadConfigurable<CountOptions>- Returns:
 - the readPreference
 
 
- 
readConcern
public CountOptions readConcern(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(ReadPreference readPreference)
Sets the readPreference- Specified by:
 readPreferencein interfacedev.morphia.internal.ReadConfigurable<CountOptions>- Parameters:
 readPreference- the readPreference- Returns:
 - this
 
 
 - 
 
 -