public final class DBCollectionFindOptions
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
batchSize |
private Collation |
collation |
private CursorType |
cursorType |
private int |
limit |
private long |
maxAwaitTimeMS |
private long |
maxTimeMS |
private DBObject |
modifiers |
private boolean |
noCursorTimeout |
private boolean |
oplogReplay |
private boolean |
partial |
private DBObject |
projection |
private ReadConcern |
readConcern |
private ReadPreference |
readPreference |
private int |
skip |
private DBObject |
sort |
Constructor and Description |
---|
DBCollectionFindOptions()
Construct a new instance
|
Modifier and Type | Method and 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(java.util.concurrent.TimeUnit timeUnit)
The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor
query.
|
long |
getMaxTime(java.util.concurrent.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,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum await execution time on the server for this operation.
|
DBCollectionFindOptions |
maxTime(long maxTime,
java.util.concurrent.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.
|
private int batchSize
private int limit
private DBObject modifiers
private DBObject projection
private long maxTimeMS
private long maxAwaitTimeMS
private int skip
private DBObject sort
private CursorType cursorType
private boolean noCursorTimeout
private boolean oplogReplay
private boolean partial
private ReadPreference readPreference
private ReadConcern readConcern
private Collation collation
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(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the time unit to return the result inpublic DBCollectionFindOptions maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
maxTime
- the max timetimeUnit
- the time unit, which may not be nullpublic long getMaxAwaitTime(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the time unit to return the result inpublic DBCollectionFindOptions maxAwaitTime(long maxAwaitTime, java.util.concurrent.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(DBObject modifiers)
modifiers
- the query modifiers to apply, which may be null.public DBObject getProjection()
public DBCollectionFindOptions projection(DBObject projection)
projection
- the project document, which may be null.public DBObject getSort()
public DBCollectionFindOptions sort(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 typepublic ReadPreference getReadPreference()
public DBCollectionFindOptions readPreference(ReadPreference readPreference)
readPreference
- the readPreferencepublic ReadConcern getReadConcern()
public DBCollectionFindOptions readConcern(ReadConcern readConcern)
readConcern
- the readConcernpublic Collation getCollation()
public DBCollectionFindOptions collation(Collation collation)
collation
- the collation