public final class DBCollectionFindOptions
extends java.lang.Object
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 |
comment(java.lang.String comment)
Sets the comment to the query.
|
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
|
java.lang.String |
getComment()
Returns the comment to send with the query.
|
CursorType |
getCursorType()
Get the cursor type.
|
DBObject |
getHint()
Returns the hint for which index to use.
|
int |
getLimit()
Gets the limit to apply.
|
DBObject |
getMax()
Returns the exclusive upper bound for a specific index.
|
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 |
getMin()
Returns the minimum inclusive lower bound for a specific index.
|
DBObject |
getModifiers()
Deprecated.
use the individual setters instead
|
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.
|
DBCollectionFindOptions |
hint(DBObject hint)
Sets the hint for which index to use.
|
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).
|
boolean |
isReturnKey()
Returns the returnKey.
|
boolean |
isShowRecordId()
Returns the showRecordId.
|
DBCollectionFindOptions |
limit(int limit)
Sets the limit to apply.
|
DBCollectionFindOptions |
max(DBObject max)
Sets the exclusive upper bound for a specific index.
|
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 |
min(DBObject min)
Sets the minimum inclusive lower bound for a specific index.
|
DBCollectionFindOptions |
modifiers(DBObject modifiers)
Deprecated.
use the individual setters instead
|
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 |
returnKey(boolean returnKey)
Sets the returnKey.
|
DBCollectionFindOptions |
showRecordId(boolean showRecordId)
Sets the showRecordId.
|
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(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 size@Deprecated public DBObject getModifiers()
@Deprecated 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@Nullable public java.lang.String getComment()
public DBCollectionFindOptions comment(@Nullable java.lang.String comment)
comment
- the comment@Nullable public DBObject getHint()
public DBCollectionFindOptions hint(@Nullable DBObject hint)
hint
- the hint@Nullable public DBObject getMax()
public DBCollectionFindOptions max(@Nullable DBObject max)
max
- the max@Nullable public DBObject getMin()
public DBCollectionFindOptions min(@Nullable DBObject min)
min
- the minpublic boolean isReturnKey()
public DBCollectionFindOptions returnKey(boolean returnKey)
returnKey
- the returnKeypublic boolean isShowRecordId()
public DBCollectionFindOptions showRecordId(boolean showRecordId)
$recordId
to the returned documents.showRecordId
- the showRecordIdCopyright © 2010 - 2023 Adobe. All Rights Reserved