class GridFSFindIterableImpl extends java.lang.Object implements GridFSFindIterable
| Modifier and Type | Field and Description |
|---|---|
private FindIterable<GridFSFile> |
underlying |
| Constructor and Description |
|---|
GridFSFindIterableImpl(FindIterable<GridFSFile> underlying) |
| Modifier and Type | Method and 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.
|
GridFSFile |
first()
Helper to return the first item in the iterator or null.
|
void |
forEach(Block<? super GridFSFile> block)
Iterates over all documents in the view, applying the given block to each.
|
<A extends java.util.Collection<? super GridFSFile>> |
into(A target)
Iterates over all the documents, adding each to the given target.
|
MongoCursor<GridFSFile> |
iterator() |
GridFSFindIterable |
limit(int limit)
Sets the limit to apply.
|
<U> MongoIterable<U> |
map(Function<GridFSFile,U> mapper)
Maps this iterable from the source document type to the target document type.
|
GridFSFindIterable |
maxTime(long maxTime,
java.util.concurrent.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.
|
private final FindIterable<GridFSFile> underlying
public GridFSFindIterableImpl(FindIterable<GridFSFile> underlying)
public GridFSFindIterable sort(Bson sort)
GridFSFindIterablesort in interface GridFSFindIterablesort - the sort criteria, which may be null.public GridFSFindIterable skip(int skip)
GridFSFindIterableskip in interface GridFSFindIterableskip - the number of documents to skippublic GridFSFindIterable limit(int limit)
GridFSFindIterablelimit in interface GridFSFindIterablelimit - the limit, which may be nullpublic GridFSFindIterable filter(Bson filter)
GridFSFindIterableBelow 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"));
filter in interface GridFSFindIterablefilter - the filter, which may be null.Filterspublic GridFSFindIterable maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
GridFSFindIterablemaxTime in interface GridFSFindIterablemaxTime - the max timetimeUnit - the time unit, which may not be nullpublic GridFSFindIterable batchSize(int batchSize)
GridFSFindIterablebatchSize in interface GridFSFindIterablebatchSize in interface MongoIterable<GridFSFile>batchSize - the batch sizepublic GridFSFindIterable collation(Collation collation)
GridFSFindIterableA null value represents the server default.
collation in interface GridFSFindIterablecollation - the collation options to usepublic GridFSFindIterable noCursorTimeout(boolean noCursorTimeout)
GridFSFindIterablenoCursorTimeout in interface GridFSFindIterablenoCursorTimeout - true if cursor timeout is disabledpublic MongoCursor<GridFSFile> iterator()
iterator in interface MongoIterable<GridFSFile>iterator in interface java.lang.Iterable<GridFSFile>public GridFSFile first()
MongoIterablefirst in interface MongoIterable<GridFSFile>public <U> MongoIterable<U> map(Function<GridFSFile,U> mapper)
MongoIterablemap in interface MongoIterable<GridFSFile>U - the target document typemapper - a function that maps from the source to the target document typepublic void forEach(Block<? super GridFSFile> block)
MongoIterableSimilar to map but the function is fully encapsulated with no returned result.
forEach in interface MongoIterable<GridFSFile>block - the block to apply to each document of type T.public <A extends java.util.Collection<? super GridFSFile>> A into(A target)
MongoIterableinto in interface MongoIterable<GridFSFile>A - the collection typetarget - the collection to insert into