FindFlow

interface FindFlow<out TResult : Any> : Flow<TResult>

Flow for find.

Since

3.0

Parameters

The type of the result.

Types

Link copied to clipboard
object Companion

Functions

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

Sets the number of documents to return per batch.

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

Sets the collation options

Link copied to clipboard
abstract suspend fun collect(collector: FlowCollector<TResult>)
Link copied to clipboard
abstract fun comment(comment: String?): FindFlow<TResult>

Sets the comment to the query. A null value means no comment is set.

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

Sets the cursor type.

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

Sets the query filter to apply to the query.

Link copied to clipboard
abstract suspend fun firstOrNull(): TResult?

Helper to return first result.

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

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

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

Sets the limit to apply.

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

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

Link copied to clipboard
abstract fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit): FindFlow<TResult>

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
abstract fun maxTime(maxTime: Long, timeUnit: TimeUnit): FindFlow<TResult>

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

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

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

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

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
abstract fun oplogReplay(oplogReplay: Boolean): FindFlow<TResult>

Users should not set this under normal circumstances.

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

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

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

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

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

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

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

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

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

Sets the number of documents to skip.

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

Sets the sort criteria to apply to the query.