Iterable<GridFSFile>
, MongoIterable<GridFSFile>
public interface GridFSFindIterable extends MongoIterable<GridFSFile>
Modifier and Type | Method | Description |
---|---|---|
GridFSFindIterable |
batchSizeβ(int batchSize) |
Sets the number of documents to return per batch.
|
GridFSFindIterable |
collationβ(Collation collation) |
Sets the collation options
|
GridFSFindIterable |
filterβ(Bson filter) |
Sets the query filter to apply to the query.
|
GridFSFindIterable |
limitβ(int limit) |
Sets the limit to apply.
|
GridFSFindIterable |
maxTimeβ(long maxTime,
TimeUnit timeUnit) |
Sets the maximum execution time on the server for this operation.
|
GridFSFindIterable |
noCursorTimeoutβ(boolean noCursorTimeout) |
The server normally times out idle cursors after an inactivity period (10 minutes)
to prevent excess memory use.
|
GridFSFindIterable |
skipβ(int skip) |
Sets the number of documents to skip.
|
GridFSFindIterable |
sortβ(Bson sort) |
Sets the sort criteria to apply to the query.
|
forEach, spliterator
GridFSFindIterable filterβ(@Nullable Bson filter)
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"));
GridFSFindIterable limitβ(int limit)
limit
- the limit, which may be nullGridFSFindIterable skipβ(int skip)
skip
- the number of documents to skipGridFSFindIterable sortβ(@Nullable Bson sort)
sort
- the sort criteria, which may be null.GridFSFindIterable noCursorTimeoutβ(boolean noCursorTimeout)
noCursorTimeout
- true if cursor timeout is disabledGridFSFindIterable maxTimeβ(long maxTime, TimeUnit timeUnit)
maxTime
- the max timetimeUnit
- the time unit, which may not be nullGridFSFindIterable batchSizeβ(int batchSize)
batchSize
in interface MongoIterable<GridFSFile>
batchSize
- the batch sizeGridFSFindIterable collationβ(@Nullable Collation collation)
A null value represents the server default.
collation
- the collation options to use