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 CountOptions
collation(Collation collation)
String
collection()
Returns the alternate collection to use for the operation.CountOptions
collection(String collection)
Sets the alternate collection to use for the operation.CountOptions
comment(String comment)
CountOptions
comment(BsonValue comment)
long
getMaxTime(TimeUnit timeUnit)
Deprecated, for removal: This API element is subject to removal in a future version.CountOptions
hint(String hint)
Defines the index hint valueCountOptions
hint(Bson hint)
CountOptions
hint(Document hint)
Defines the index hint valueCountOptions
hintString(String hint)
CountOptions
limit(int limit)
CountOptions
maxTime(long maxTime, TimeUnit timeUnit)
ReadConcern
readConcern()
Returns the readConcernCountOptions
readConcern(ReadConcern readConcern)
Sets the readConcernReadPreference
readPreference()
Returns the readPreferenceCountOptions
readPreference(ReadPreference readPreference)
Sets the readPreferenceCountOptions
skip(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.CollectionConfigurable
Sets the alternate collection to use for the operation.- Specified by:
collection
in 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.CollectionConfigurable
Returns the alternate collection to use for the operation. Might return null.- Specified by:
collection
in 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:
hint
in classCountOptions
-
hintString
public CountOptions hintString(@Nullable String hint)
- Overrides:
hintString
in classCountOptions
-
limit
public CountOptions limit(int limit)
- Overrides:
limit
in classCountOptions
-
skip
public CountOptions skip(int skip)
- Overrides:
skip
in 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:
getMaxTime
in classCountOptions
-
maxTime
public CountOptions maxTime(long maxTime, TimeUnit timeUnit)
- Overrides:
maxTime
in classCountOptions
-
collation
public CountOptions collation(@Nullable Collation collation)
- Overrides:
collation
in classCountOptions
-
comment
public CountOptions comment(String comment)
- Overrides:
comment
in classCountOptions
- Returns:
- this
- Since:
- 2.3
-
comment
public CountOptions comment(BsonValue comment)
- Overrides:
comment
in classCountOptions
- Returns:
- this
- Since:
- 2.3
-
readConcern
public ReadConcern readConcern()
Returns the readConcern- Specified by:
readConcern
in interfacedev.morphia.internal.ReadConfigurable<CountOptions>
- Returns:
- the readConcern
- Since server release
- 3.2
-
readPreference
public ReadPreference readPreference()
Returns the readPreference- Specified by:
readPreference
in interfacedev.morphia.internal.ReadConfigurable<CountOptions>
- Returns:
- the readPreference
-
readConcern
public CountOptions readConcern(ReadConcern readConcern)
Sets the readConcern- Specified by:
readConcern
in 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:
readPreference
in interfacedev.morphia.internal.ReadConfigurable<CountOptions>
- Parameters:
readPreference
- the readPreference- Returns:
- this
-
-