public class FindOptions extends Object
find.| Constructor and Description |
|---|
FindOptions() |
| Modifier and Type | Method and Description |
|---|---|
<T> com.mongodb.reactivestreams.client.FindPublisher<T> |
apply(com.mongodb.reactivestreams.client.FindPublisher<T> stream) |
FindOptions |
batchSize(int size)
Sets the number of documents to return per batch.
|
FindOptions |
collation(com.mongodb.client.model.Collation collation)
Sets the collation options
|
FindOptions |
comment(String comment)
Sets the comment to the query.
|
FindOptions |
cursorType(com.mongodb.CursorType cursorType)
Sets the cursor type.
|
FindOptions |
filter(org.bson.conversions.Bson filter)
Sets the query filter to apply to the query.
|
FindOptions |
hint(org.bson.conversions.Bson hint)
Sets the hint for which index to use.
|
FindOptions |
limit(int limit)
Sets the limit to apply.
|
FindOptions |
max(org.bson.conversions.Bson max)
Sets the exclusive upper bound for a specific index.
|
FindOptions |
maxAwaitTime(long maxAwaitTime,
TimeUnit timeUnit)
The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor
query.
|
FindOptions |
maxTime(long maxTime,
TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.
|
FindOptions |
min(org.bson.conversions.Bson min)
Sets the minimum inclusive lower bound for a specific index.
|
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 |
projection(org.bson.conversions.Bson projection)
Sets a document describing the fields to return for all matching documents.
|
FindOptions |
returnKey(boolean returnKey)
Sets the returnKey.
|
FindOptions |
showRecordId(boolean showRecordId)
Sets the showRecordId.
|
FindOptions |
skip(int skip)
Sets the number of documents to skip.
|
FindOptions |
sort(org.bson.conversions.Bson sort)
Sets the sort criteria to apply to the query.
|
public FindOptions filter(org.bson.conversions.Bson filter)
filter - the filter, which may be null.public FindOptions limit(int limit)
limit - the limit, which may be nullpublic FindOptions skip(int skip)
skip - the number of documents to skippublic FindOptions maxTime(long maxTime, TimeUnit timeUnit)
maxTime - the max timetimeUnit - the time unit, which may not be nullpublic FindOptions maxAwaitTime(long maxAwaitTime, TimeUnit timeUnit)
On servers >= 3.2, this option will be specified on the getMore command as "maxTimeMS". The default is no value: no "maxTimeMS" is sent to the server with the getMore command.
On servers < 3.2, this option is ignored, and indicates that the driver should respect the server's default value
A zero value will be ignored.
maxAwaitTime - the max await timetimeUnit - the time unit to return the result inpublic FindOptions projection(org.bson.conversions.Bson projection)
projection - the project document, which may be null.public FindOptions sort(org.bson.conversions.Bson sort)
sort - the sort criteria, which may be null.public FindOptions noCursorTimeout(boolean noCursorTimeout)
noCursorTimeout - true if cursor timeout is disabledpublic FindOptions oplogReplay(boolean oplogReplay)
oplogReplay - if oplog replay is enabledpublic FindOptions partial(boolean partial)
partial - if partial results for sharded clusters is enabledpublic FindOptions cursorType(com.mongodb.CursorType cursorType)
cursorType - the cursor typepublic FindOptions collation(com.mongodb.client.model.Collation collation)
A null value represents the server default.
collation - the collation options to usepublic FindOptions comment(String comment)
comment - the commentpublic FindOptions hint(org.bson.conversions.Bson hint)
hint - the hintpublic FindOptions max(org.bson.conversions.Bson max)
max - the maxpublic FindOptions min(org.bson.conversions.Bson min)
min - the minpublic FindOptions returnKey(boolean returnKey)
returnKey - the returnKeypublic FindOptions showRecordId(boolean showRecordId)
$recordId to the returned documents.showRecordId - the showRecordIdpublic FindOptions batchSize(int size)
Overrides the Subscription.request(long) value for setting the batch size, allowing for fine
grained
control over the underlying cursor.
size - the batch sizepublic <T> com.mongodb.reactivestreams.client.FindPublisher<T> apply(com.mongodb.reactivestreams.client.FindPublisher<T> stream)
Copyright © 2021 JBoss by Red Hat. All rights reserved.