Interface DistinctIterable<TResult>

Type Parameters:
TResult - The type of the result.
All Superinterfaces:
Iterable<TResult>, MongoIterable<TResult>

public interface DistinctIterable<TResult> extends MongoIterable<TResult>
Iterable interface for distinct.
Since:
3.0
  • Method Details

    • filter

      DistinctIterable<TResult> filter(@Nullable org.bson.conversions.Bson filter)
      Sets the query filter to apply to the query.
      Parameters:
      filter - the filter, which may be null.
      Returns:
      this
      MongoDB documentation
      Filter
    • maxTime

      DistinctIterable<TResult> maxTime(long maxTime, TimeUnit timeUnit)
      Sets the maximum execution time on the server for this operation.
      Parameters:
      maxTime - the max time
      timeUnit - the time unit, which may not be null
      Returns:
      this
    • batchSize

      DistinctIterable<TResult> batchSize(int batchSize)
      Sets the number of documents to return per batch.
      Specified by:
      batchSize in interface MongoIterable<TResult>
      Parameters:
      batchSize - the batch size
      Returns:
      this
      MongoDB documentation
      Batch Size
    • collation

      DistinctIterable<TResult> collation(@Nullable com.mongodb.client.model.Collation collation)
      Sets the collation options

      A null value represents the server default.

      Parameters:
      collation - the collation options to use
      Returns:
      this
      Since:
      3.4
      Since server release
      3.4
    • comment

      DistinctIterable<TResult> comment(@Nullable String comment)
      Sets the comment for this operation. A null value means no comment is set.
      Parameters:
      comment - the comment
      Returns:
      this
      Since:
      4.6
      Since server release
      4.4
    • comment

      DistinctIterable<TResult> comment(@Nullable org.bson.BsonValue comment)
      Sets the comment for this operation. A null value means no comment is set.
      Parameters:
      comment - the comment
      Returns:
      this
      Since:
      4.6
      Since server release
      4.4
    • hint

      DistinctIterable<TResult> hint(@Nullable org.bson.conversions.Bson hint)
      Sets the hint for which index to use. A null value means no hint is set.
      Parameters:
      hint - the hint
      Returns:
      this
      Since:
      5.3
    • hintString

      DistinctIterable<TResult> hintString(@Nullable String hint)
      Sets the hint to apply.

      Note: If hint(Bson) is set that will be used instead of any hint string.

      Parameters:
      hint - the name of the index which should be used for the operation
      Returns:
      this
      Since:
      5.3
    • timeoutMode

      @Alpha(CLIENT) DistinctIterable<TResult> timeoutMode(com.mongodb.client.cursor.TimeoutMode timeoutMode)
      Sets the timeoutMode for the cursor.

      Requires the timeout to be set, either in the MongoClientSettings, via MongoDatabase or via MongoCollection

      Parameters:
      timeoutMode - the timeout mode
      Returns:
      this
      Since:
      5.2