Interface GridFSFindIterable

All Superinterfaces:
Iterable<GridFSFile>, MongoIterable<GridFSFile>

public interface GridFSFindIterable extends MongoIterable<GridFSFile>
Iterable for the GridFS Files Collection.
Since:
3.1
  • Method Details

    • filter

      Sets the query filter to apply to the query.

      Below is an example of filtering against the filename and some nested metadata that can also be stored along with the file data:

        
            Filters.and(Filters.eq("filename", "mongodb.png"), Filters.eq("metadata.contentType", "image/png"));
        
        
      Parameters:
      filter - the filter, which may be null.
      Returns:
      this
      See Also:
      MongoDB documentation
      Filter
    • limit

      GridFSFindIterable limit(int limit)
      Sets the limit to apply.
      Parameters:
      limit - the limit, which may be null
      Returns:
      this
      MongoDB documentation
      Limit
    • skip

      GridFSFindIterable skip(int skip)
      Sets the number of documents to skip.
      Parameters:
      skip - the number of documents to skip
      Returns:
      this
      MongoDB documentation
      Skip
    • sort

      Sets the sort criteria to apply to the query.
      Parameters:
      sort - the sort criteria, which may be null.
      Returns:
      this
      MongoDB documentation
      Sort
    • noCursorTimeout

      GridFSFindIterable noCursorTimeout(boolean noCursorTimeout)
      The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that.
      Parameters:
      noCursorTimeout - true if cursor timeout is disabled
      Returns:
      this
    • maxTime

      GridFSFindIterable 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
      MongoDB documentation
      Max Time
    • batchSize

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

      GridFSFindIterable collation(@Nullable 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