Constructor and Description |
---|
FindOptions()
Creates an empty options instance.
|
Modifier and Type | Method and Description |
---|---|
FindOptions |
batchSize(int batchSize)
Sets the number of documents to return per batch.
|
FindOptions |
collation(Collation collation)
Sets the collation
|
FindOptions |
copy()
Makes a copy of these find options
|
FindOptions |
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.
|
ReadConcern |
getReadConcern()
Returns the readConcern
|
ReadPreference |
getReadPreference()
Returns the readPreference
|
int |
getSkip()
Gets the number of documents to skip.
|
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).
|
FindOptions |
limit(int limit)
Sets the limit to apply.
|
FindOptions |
maxAwaitTime(long maxAwaitTime,
TimeUnit timeUnit)
Sets the maximum await execution time on the server for this operation.
|
FindOptions |
maxTime(long maxTime,
TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.
|
FindOptions |
modifier(String key,
Object value)
Adds a modifier to the find operation
|
FindOptions |
noCursorTimeout(boolean noCursorTimeout)
The server normally times out idle cursors after an inactivity period (10 minutes)
to prevent excess memory use.
|
FindOptions |
oplogReplay(boolean oplogReplay)
Users should not set this under normal circumstances.
|
FindOptions |
partial(boolean partial)
Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).
|
FindOptions |
readConcern(ReadConcern readConcern)
Sets the readConcern
|
FindOptions |
readPreference(ReadPreference readPreference)
Sets the readPreference
|
FindOptions |
skip(int skip)
Sets the number of documents to skip.
|
public FindOptions copy()
public int getLimit()
public FindOptions limit(int limit)
limit
- the limit, which may be nullpublic int getSkip()
public FindOptions skip(int skip)
skip
- the number of documents to skippublic long getMaxTime(TimeUnit timeUnit)
timeUnit
- the time unit to return the result inpublic FindOptions 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 FindOptions 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 FindOptions batchSize(int batchSize)
batchSize
- the batch sizepublic FindOptions modifier(String key, Object value)
key
- the modifier namevalue
- the modifier valuepublic boolean isNoCursorTimeout()
public FindOptions noCursorTimeout(boolean noCursorTimeout)
noCursorTimeout
- true if cursor timeout is disabledpublic boolean isOplogReplay()
public FindOptions oplogReplay(boolean oplogReplay)
oplogReplay
- if oplog replay is enabledpublic boolean isPartial()
public FindOptions partial(boolean partial)
partial
- if partial results for sharded clusters is enabledpublic CursorType getCursorType()
public FindOptions cursorType(CursorType cursorType)
cursorType
- the cursor typepublic ReadPreference getReadPreference()
public FindOptions readPreference(ReadPreference readPreference)
readPreference
- the readPreferencepublic ReadConcern getReadConcern()
public FindOptions readConcern(ReadConcern readConcern)
readConcern
- the readConcernpublic Collation getCollation()
public FindOptions collation(Collation collation)
collation
- the collation