FindFlow

class FindFlow<T : Any>(wrapped: FindPublisher<T>) : Flow<T>

Flow implementation for find operations.

Parameters

T

The type of the result.

See also

Constructors

Link copied to clipboard
constructor(wrapped: FindPublisher<T>)

Functions

Link copied to clipboard
fun allowDiskUse(allowDiskUse: Boolean?): FindFlow<T>

Enables writing to temporary files on the server. When set to true, the server can write temporary data to disk while executing the find operation.

Link copied to clipboard
fun batchSize(batchSize: Int): FindFlow<T>

Sets the number of documents to return per batch.

Link copied to clipboard
fun collation(collation: Collation?): FindFlow<T>

Sets the collation options

Link copied to clipboard
open suspend override fun collect(collector: FlowCollector<T>)
Link copied to clipboard
fun comment(comment: String?): FindFlow<T>
fun comment(comment: BsonValue?): FindFlow<T>

Sets the comment for this operation. A null value means no comment is set.

Link copied to clipboard
fun cursorType(cursorType: CursorType): FindFlow<T>

Sets the cursor type.

Link copied to clipboard
@JvmName(name = "explainDocument")
suspend fun explain(verbosity: ExplainVerbosity? = null): Document
inline suspend fun <R : Any> explain(verbosity: ExplainVerbosity? = null): R
suspend fun <R : Any> explain(resultClass: Class<R>, verbosity: ExplainVerbosity? = null): R

Explain the execution plan for this operation with the given verbosity level

Link copied to clipboard
fun filter(filter: Bson?): FindFlow<T>

Sets the query filter to apply to the query.

Link copied to clipboard
fun hint(hint: Bson?): FindFlow<T>

Sets the hint for which index to use. A null value means no hint is set.

Link copied to clipboard
fun hintString(hint: String?): FindFlow<T>

Sets the hint to apply.

Link copied to clipboard
fun let(variables: Bson?): FindFlow<T>

Add top-level variables to the operation. A null value means no variables are set.

Link copied to clipboard
fun limit(limit: Int): FindFlow<T>

Sets the limit to apply.

Link copied to clipboard
fun max(max: Bson?): FindFlow<T>

Sets the exclusive upper bound for a specific index. A null value means no max is set.

Link copied to clipboard
fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): FindFlow<T>

The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. This only applies to a TAILABLE_AWAIT cursor. When the cursor is not a TAILABLE_AWAIT cursor, this option is ignored.

Link copied to clipboard
fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): FindFlow<T>

Sets the maximum execution time on the server for this operation.

Link copied to clipboard
fun min(min: Bson?): FindFlow<T>

Sets the minimum inclusive lower bound for a specific index. A null value means no max is set.

Link copied to clipboard
fun noCursorTimeout(noCursorTimeout: Boolean): FindFlow<T>

The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that.

Link copied to clipboard
fun oplogReplay(oplogReplay: Boolean): FindFlow<T>

Users should not set this under normal circumstances.

Link copied to clipboard
fun partial(partial: Boolean): FindFlow<T>

Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).

Link copied to clipboard
fun projection(projection: Bson?): FindFlow<T>

Sets a document describing the fields to return for all matching documents.

Link copied to clipboard
fun returnKey(returnKey: Boolean): FindFlow<T>

Sets the returnKey. If true the find operation will return only the index keys in the resulting documents.

Link copied to clipboard
fun showRecordId(showRecordId: Boolean): FindFlow<T>

Sets the showRecordId. Set to true to add a field $recordId to the returned documents.

Link copied to clipboard
fun skip(skip: Int): FindFlow<T>

Sets the number of documents to skip.

Link copied to clipboard
fun sort(sort: Bson?): FindFlow<T>

Sets the sort criteria to apply to the query.