Package com.mongodb.client.model
Class DBCollectionDistinctOptions
java.lang.Object
com.mongodb.client.model.DBCollectionDistinctOptions
The options for a distinct operation.
- Since:
- 3.4
- MongoDB documentation
- Count
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncollation
(com.mongodb.client.model.Collation collation) Sets the collationfilter
(com.mongodb.DBObject filter) Sets the selection query to determine the subset of documents from which to retrieve the distinct values.com.mongodb.client.model.Collation
Returns the collation optionscom.mongodb.DBObject
Gets the selection query to determine the subset of documents from which to retrieve the distinct valuescom.mongodb.ReadConcern
Returns the readConcerncom.mongodb.ReadPreference
Returns the readPreferencereadConcern
(com.mongodb.ReadConcern readConcern) Sets the readConcernreadPreference
(com.mongodb.ReadPreference readPreference) Sets the readPreference
-
Constructor Details
-
DBCollectionDistinctOptions
public DBCollectionDistinctOptions()Construct a new instance
-
-
Method Details
-
getFilter
@Nullable public com.mongodb.DBObject getFilter()Gets the selection query to determine the subset of documents from which to retrieve the distinct values- Returns:
- the query
-
filter
Sets the selection query to determine the subset of documents from which to retrieve the distinct values.- Parameters:
filter
- the selection query to determine the subset of documents from which to retrieve the distinct values- Returns:
- this
-
getReadPreference
@Nullable public com.mongodb.ReadPreference getReadPreference()Returns the readPreference- Returns:
- the readPreference
-
readPreference
public DBCollectionDistinctOptions readPreference(@Nullable com.mongodb.ReadPreference readPreference) Sets the readPreference- Parameters:
readPreference
- the readPreference- Returns:
- this
-
getReadConcern
@Nullable public com.mongodb.ReadConcern getReadConcern()Returns the readConcern- Returns:
- the readConcern
- Since server release
- 3.2
-
readConcern
Sets the readConcern- Parameters:
readConcern
- the readConcern- Returns:
- this
- Since server release
- 3.2
-
getCollation
@Nullable public com.mongodb.client.model.Collation getCollation()Returns the collation options- Returns:
- the collation options
- Since server release
- 3.4
-
collation
public DBCollectionDistinctOptions collation(@Nullable com.mongodb.client.model.Collation collation) Sets the collation- Parameters:
collation
- the collation- Returns:
- this
- Since server release
- 3.4
-