final class FindIterableImpl<TDocument,TResult> extends MongoIterableImpl<TResult> implements FindIterable<TResult>
| Modifier and Type | Field and Description |
|---|---|
private CodecRegistry |
codecRegistry |
private java.lang.Class<TDocument> |
documentClass |
private Bson |
filter |
private FindOptions |
findOptions |
private MongoNamespace |
namespace |
private java.lang.Class<TResult> |
resultClass |
| Constructor and Description |
|---|
FindIterableImpl(ClientSession clientSession,
MongoNamespace namespace,
java.lang.Class<TDocument> documentClass,
java.lang.Class<TResult> resultClass,
CodecRegistry codecRegistry,
ReadPreference readPreference,
ReadConcern readConcern,
OperationExecutor executor,
Bson filter,
FindOptions findOptions) |
| Modifier and Type | Method and Description |
|---|---|
protected ReadOperation<BatchCursor<TResult>> |
asReadOperation() |
FindIterable<TResult> |
batchSize(int batchSize)
Sets the number of documents to return per batch.
|
FindIterable<TResult> |
collation(Collation collation)
Sets the collation options
|
FindIterable<TResult> |
comment(java.lang.String comment)
Sets the comment to the query.
|
private FindOperation<TResult> |
createQueryOperation() |
FindIterable<TResult> |
cursorType(CursorType cursorType)
Sets the cursor type.
|
FindIterable<TResult> |
filter(Bson filter)
Sets the query filter to apply to the query.
|
TResult |
first()
Helper to return the first item in the iterator or null.
|
FindIterable<TResult> |
hint(Bson hint)
Sets the hint for which index to use.
|
FindIterable<TResult> |
limit(int limit)
Sets the limit to apply.
|
FindIterable<TResult> |
max(Bson max)
Sets the exclusive upper bound for a specific index.
|
FindIterable<TResult> |
maxAwaitTime(long maxAwaitTime,
java.util.concurrent.TimeUnit timeUnit)
The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor
query.
|
FindIterable<TResult> |
maxScan(long maxScan)
Sets the maximum number of documents or index keys to scan when executing the query.
|
FindIterable<TResult> |
maxTime(long maxTime,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.
|
FindIterable<TResult> |
min(Bson min)
Sets the minimum inclusive lower bound for a specific index.
|
FindIterable<TResult> |
modifiers(Bson modifiers)
Sets the query modifiers to apply to this operation.
|
FindIterable<TResult> |
noCursorTimeout(boolean noCursorTimeout)
The server normally times out idle cursors after an inactivity period (10 minutes)
to prevent excess memory use.
|
FindIterable<TResult> |
oplogReplay(boolean oplogReplay)
Users should not set this under normal circumstances.
|
FindIterable<TResult> |
partial(boolean partial)
Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).
|
FindIterable<TResult> |
projection(Bson projection)
Sets a document describing the fields to return for all matching documents.
|
FindIterable<TResult> |
returnKey(boolean returnKey)
Sets the returnKey.
|
FindIterable<TResult> |
showRecordId(boolean showRecordId)
Sets the showRecordId.
|
FindIterable<TResult> |
skip(int skip)
Sets the number of documents to skip.
|
FindIterable<TResult> |
snapshot(boolean snapshot)
Sets the snapshot.
|
FindIterable<TResult> |
sort(Bson sort)
Sets the sort criteria to apply to the query.
|
forEach, getBatchSize, getClientSession, getExecutor, getReadConcern, getReadPreference, into, iterator, map, toBsonDocumentOrNull, toBsonDocumentOrNullclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, into, iterator, mapprivate final MongoNamespace namespace
private final java.lang.Class<TDocument> documentClass
private final java.lang.Class<TResult> resultClass
private final CodecRegistry codecRegistry
private final FindOptions findOptions
private Bson filter
FindIterableImpl(ClientSession clientSession, MongoNamespace namespace, java.lang.Class<TDocument> documentClass, java.lang.Class<TResult> resultClass, CodecRegistry codecRegistry, ReadPreference readPreference, ReadConcern readConcern, OperationExecutor executor, Bson filter, FindOptions findOptions)
public FindIterable<TResult> filter(Bson filter)
FindIterablefilter in interface FindIterable<TResult>filter - the filter, which may be null.public FindIterable<TResult> limit(int limit)
FindIterablelimit in interface FindIterable<TResult>limit - the limit, which may be nullpublic FindIterable<TResult> skip(int skip)
FindIterableskip in interface FindIterable<TResult>skip - the number of documents to skippublic FindIterable<TResult> maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
FindIterablemaxTime in interface FindIterable<TResult>maxTime - the max timetimeUnit - the time unit, which may not be nullpublic FindIterable<TResult> maxAwaitTime(long maxAwaitTime, java.util.concurrent.TimeUnit timeUnit)
FindIterablemaxAwaitTime in interface FindIterable<TResult>maxAwaitTime - the max await timetimeUnit - the time unit to return the result inpublic FindIterable<TResult> batchSize(int batchSize)
MongoIterablebatchSize in interface FindIterable<TResult>batchSize in interface MongoIterable<TResult>batchSize in class MongoIterableImpl<TResult>batchSize - the batch sizepublic FindIterable<TResult> collation(Collation collation)
FindIterableA null value represents the server default.
collation in interface FindIterable<TResult>collation - the collation options to usepublic FindIterable<TResult> modifiers(Bson modifiers)
FindIterablemodifiers in interface FindIterable<TResult>modifiers - the query modifiers to apply, which may be null.public FindIterable<TResult> projection(Bson projection)
FindIterableprojection in interface FindIterable<TResult>projection - the project document, which may be null.public FindIterable<TResult> sort(Bson sort)
FindIterablesort in interface FindIterable<TResult>sort - the sort criteria, which may be null.public FindIterable<TResult> noCursorTimeout(boolean noCursorTimeout)
FindIterablenoCursorTimeout in interface FindIterable<TResult>noCursorTimeout - true if cursor timeout is disabledpublic FindIterable<TResult> oplogReplay(boolean oplogReplay)
FindIterableoplogReplay in interface FindIterable<TResult>oplogReplay - if oplog replay is enabledpublic FindIterable<TResult> partial(boolean partial)
FindIterablepartial in interface FindIterable<TResult>partial - if partial results for sharded clusters is enabledpublic FindIterable<TResult> cursorType(CursorType cursorType)
FindIterablecursorType in interface FindIterable<TResult>cursorType - the cursor typepublic FindIterable<TResult> comment(java.lang.String comment)
FindIterablecomment in interface FindIterable<TResult>comment - the commentpublic FindIterable<TResult> hint(Bson hint)
FindIterablehint in interface FindIterable<TResult>hint - the hintpublic FindIterable<TResult> max(Bson max)
FindIterablemax in interface FindIterable<TResult>max - the maxpublic FindIterable<TResult> min(Bson min)
FindIterablemin in interface FindIterable<TResult>min - the minpublic FindIterable<TResult> maxScan(long maxScan)
FindIterablemaxScan in interface FindIterable<TResult>maxScan - the maxScanpublic FindIterable<TResult> returnKey(boolean returnKey)
FindIterablereturnKey in interface FindIterable<TResult>returnKey - the returnKeypublic FindIterable<TResult> showRecordId(boolean showRecordId)
FindIterable$recordId to the returned documents.showRecordId in interface FindIterable<TResult>showRecordId - the showRecordIdpublic FindIterable<TResult> snapshot(boolean snapshot)
FindIterablesnapshot in interface FindIterable<TResult>snapshot - the snapshotpublic TResult first()
MongoIterablefirst in interface MongoIterable<TResult>first in class MongoIterableImpl<TResult>protected ReadOperation<BatchCursor<TResult>> asReadOperation()
asReadOperation in class MongoIterableImpl<TResult>private FindOperation<TResult> createQueryOperation()