Constructor | Description |
---|---|
DBCollectionFindOptions() |
Construct a new instance
|
Modifier and Type | Method | Description |
---|---|---|
DBCollectionFindOptions |
batchSize(int batchSize) |
Sets the number of documents to return per batch.
|
DBCollectionFindOptions |
collation(Collation collation) |
Sets the collation
|
DBCollectionFindOptions |
copy() |
Copy this DBCollectionFindOptions instance into a new instance.
|
DBCollectionFindOptions |
cursorType(CursorType cursorType) |
Sets the cursor type.
|
int |
getBatchSize() |
Gets the number of documents to return per batch.
|
Collation |
getCollation() |
Returns the collation options
|
CursorType |
getCursorType() |
Get the cursor type.
|
int |
getLimit() |
Gets the limit to apply.
|
long |
getMaxAwaitTime(TimeUnit timeUnit) |
The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor
query.
|
long |
getMaxTime(TimeUnit timeUnit) |
Gets the maximum execution time on the server for this operation.
|
DBObject |
getModifiers() |
Gets the query modifiers to apply to this operation.
|
DBObject |
getProjection() |
Gets a document describing the fields to return for all matching documents.
|
ReadConcern |
getReadConcern() |
Returns the readConcern
|
ReadPreference |
getReadPreference() |
Returns the readPreference
|
int |
getSkip() |
Gets the number of documents to skip.
|
DBObject |
getSort() |
Gets the sort criteria to apply to the query.
|
boolean |
isNoCursorTimeout() |
The server normally times out idle cursors after an inactivity period (10 minutes)
to prevent excess memory use.
|
boolean |
isOplogReplay() |
Users should not set this under normal circumstances.
|
boolean |
isPartial() |
Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).
|
DBCollectionFindOptions |
limit(int limit) |
Sets the limit to apply.
|
DBCollectionFindOptions |
maxAwaitTime(long maxAwaitTime,
TimeUnit timeUnit) |
Sets the maximum await execution time on the server for this operation.
|
DBCollectionFindOptions |
maxTime(long maxTime,
TimeUnit timeUnit) |
Sets the maximum execution time on the server for this operation.
|
DBCollectionFindOptions |
modifiers(DBObject modifiers) |
Sets the query modifiers to apply to this operation.
|
DBCollectionFindOptions |
noCursorTimeout(boolean noCursorTimeout) |
The server normally times out idle cursors after an inactivity period (10 minutes)
to prevent excess memory use.
|
DBCollectionFindOptions |
oplogReplay(boolean oplogReplay) |
Users should not set this under normal circumstances.
|
DBCollectionFindOptions |
partial(boolean partial) |
Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).
|
DBCollectionFindOptions |
projection(DBObject projection) |
Sets a document describing the fields to return for all matching documents.
|
DBCollectionFindOptions |
readConcern(ReadConcern readConcern) |
Sets the readConcern
|
DBCollectionFindOptions |
readPreference(ReadPreference readPreference) |
Sets the readPreference
|
DBCollectionFindOptions |
skip(int skip) |
Sets the number of documents to skip.
|
DBCollectionFindOptions |
sort(DBObject sort) |
Sets the sort criteria to apply to the query.
|
public DBCollectionFindOptions()
public DBCollectionFindOptions copy()
public int getLimit()
public DBCollectionFindOptions limit(int limit)
limit
- the limit, which may be nullpublic int getSkip()
public DBCollectionFindOptions skip(int skip)
skip
- the number of documents to skippublic long getMaxTime(TimeUnit timeUnit)
timeUnit
- the time unit to return the result inpublic DBCollectionFindOptions maxTime(long maxTime, TimeUnit timeUnit)
maxTime
- the max timetimeUnit
- the time unit, which may not be nullpublic long getMaxAwaitTime(TimeUnit timeUnit)
timeUnit
- the time unit to return the result inpublic DBCollectionFindOptions maxAwaitTime(long maxAwaitTime, TimeUnit timeUnit)
maxAwaitTime
- the max await time. A zero value will be ignored, and indicates that the driver should respect the server's
default valuetimeUnit
- the time unit, which may not be nullpublic int getBatchSize()
public DBCollectionFindOptions batchSize(int batchSize)
batchSize
- the batch sizepublic DBObject getModifiers()
public DBCollectionFindOptions modifiers(@Nullable DBObject modifiers)
modifiers
- the query modifiers to apply, which may be null.@Nullable public DBObject getProjection()
public DBCollectionFindOptions projection(@Nullable DBObject projection)
projection
- the project document, which may be null.@Nullable public DBObject getSort()
public DBCollectionFindOptions sort(@Nullable DBObject sort)
sort
- the sort criteria, which may be null.public boolean isNoCursorTimeout()
public DBCollectionFindOptions noCursorTimeout(boolean noCursorTimeout)
noCursorTimeout
- true if cursor timeout is disabledpublic boolean isOplogReplay()
public DBCollectionFindOptions oplogReplay(boolean oplogReplay)
oplogReplay
- if oplog replay is enabledpublic boolean isPartial()
public DBCollectionFindOptions partial(boolean partial)
partial
- if partial results for sharded clusters is enabledpublic CursorType getCursorType()
public DBCollectionFindOptions cursorType(CursorType cursorType)
cursorType
- the cursor type@Nullable public ReadPreference getReadPreference()
public DBCollectionFindOptions readPreference(@Nullable ReadPreference readPreference)
readPreference
- the readPreference@Nullable public ReadConcern getReadConcern()
public DBCollectionFindOptions readConcern(@Nullable ReadConcern readConcern)
readConcern
- the readConcern@Nullable public Collation getCollation()
public DBCollectionFindOptions collation(@Nullable Collation collation)
collation
- the collation