Package io.vertx.mongo.client.gridfs
Class GridFSFindOptions
- java.lang.Object
-
- io.vertx.mongo.client.gridfs.GridFSFindOptions
-
public class GridFSFindOptions extends java.lang.Object
Options for the GridFS Files Collection.- Since:
- 1.3
-
-
Constructor Summary
Constructors Constructor Description GridFSFindOptions()
GridFSFindOptions(JsonObject json)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Integer
getBatchSize()
Collation
getCollation()
JsonObject
getFilter()
java.lang.Integer
getLimit()
java.lang.Long
getMaxTime()
java.lang.Integer
getSkip()
JsonObject
getSort()
java.lang.Boolean
isNoCursorTimeout()
GridFSFindOptions
setBatchSize(java.lang.Integer batchSize)
Sets the number of documents to return per batch.GridFSFindOptions
setCollation(Collation collation)
Sets the collation optionsGridFSFindOptions
setFilter(JsonObject filter)
Sets the query filter to apply to the query.GridFSFindOptions
setLimit(java.lang.Integer limit)
Sets the limit to apply.GridFSFindOptions
setMaxTime(java.lang.Long maxTime)
Sets the maximum execution time on the server for this operation.GridFSFindOptions
setNoCursorTimeout(java.lang.Boolean noCursorTimeout)
The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use.GridFSFindOptions
setSkip(java.lang.Integer skip)
Sets the number of documents to skip.GridFSFindOptions
setSort(JsonObject sort)
Sets the sort criteria to apply to the query.JsonObject
toJson()
-
-
-
Constructor Detail
-
GridFSFindOptions
public GridFSFindOptions()
-
GridFSFindOptions
public GridFSFindOptions(JsonObject json)
-
-
Method Detail
-
toJson
public JsonObject toJson()
-
setFilter
public GridFSFindOptions setFilter(JsonObject 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"));
-
getFilter
public JsonObject getFilter()
-
setLimit
public GridFSFindOptions setLimit(java.lang.Integer limit)
Sets the limit to apply.- Parameters:
limit
- the limit, which may be null- Returns:
- this
- MongoDB documentation
- Limit
-
getLimit
public java.lang.Integer getLimit()
-
setSkip
public GridFSFindOptions setSkip(java.lang.Integer skip)
Sets the number of documents to skip.- Parameters:
skip
- the number of documents to skip- Returns:
- this
- MongoDB documentation
- Skip
-
getSkip
public java.lang.Integer getSkip()
-
setSort
public GridFSFindOptions setSort(JsonObject sort)
Sets the sort criteria to apply to the query.- Parameters:
sort
- the sort criteria, which may be null.- Returns:
- this
- MongoDB documentation
- Sort
-
getSort
public JsonObject getSort()
-
setNoCursorTimeout
public GridFSFindOptions setNoCursorTimeout(java.lang.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
-
isNoCursorTimeout
public java.lang.Boolean isNoCursorTimeout()
-
setMaxTime
public GridFSFindOptions setMaxTime(java.lang.Long maxTime)
Sets the maximum execution time on the server for this operation.- Parameters:
maxTime
- the max time (in milliseconds)- Returns:
- this
- MongoDB documentation
- Max Time
-
getMaxTime
public java.lang.Long getMaxTime()
-
setCollation
public GridFSFindOptions setCollation(Collation collation)
Sets the collation optionsA null value represents the server default.
- Parameters:
collation
- the collation options to use- Returns:
- this
- Since:
- 1.3
- Since server release
- 3.4
-
getCollation
public Collation getCollation()
-
setBatchSize
public GridFSFindOptions setBatchSize(java.lang.Integer batchSize)
Sets the number of documents to return per batch.Overrides the
Subscription.request(long)
value for setting the batch size, allowing for fine grained control over the underlying cursor.- Parameters:
batchSize
- the batch size- Returns:
- this
- Since:
- 1.8
- MongoDB documentation
- Batch Size
-
getBatchSize
public java.lang.Integer getBatchSize()
-
-