ListSearchIndexesIterable

class ListSearchIndexesIterable<T : Any>(wrapped: ListSearchIndexesIterable<T>) : MongoIterable<T>

Iterable like implementation for list Atlas Search index operations.

Parameters

T

The type of the result.

See also

Constructors

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

Functions

Link copied to clipboard

Enables writing to temporary files. A null value indicates that it's unspecified.

Link copied to clipboard
open override fun batchSize(batchSize: Int): ListSearchIndexesIterable<T>

Sets the number of documents to return per batch.

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

Sets the collation options.

Link copied to clipboard
fun comment(comment: BsonValue?): ListSearchIndexesIterable<T>

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

Link copied to clipboard
open fun cursor(): MongoCursor<T>

Returns a cursor used for iterating over elements of type `T. The cursor is primarily used for change streams.

Link copied to clipboard
fun explain(verbosity: ExplainVerbosity? = null): Document
inline fun <R : Any> explain(verbosity: ExplainVerbosity? = null): R
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 first(): T
Link copied to clipboard
fun firstOrNull(): T?
Link copied to clipboard
fun forEach(action: (T) -> Unit)

Performs the given action on each element and safely closes the cursor.

Link copied to clipboard
fun <R> map(transform: (T) -> R): MongoIterable<R>

Maps this iterable from the source document type to the target document type.

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

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

Link copied to clipboard

Sets an Atlas Search index name for this operation.

Link copied to clipboard
@Alpha(value = [Reason.CLIENT])
fun timeoutMode(timeoutMode: TimeoutMode): ListSearchIndexesIterable<T>

Sets the timeoutMode for the cursor.

Link copied to clipboard
fun <C : MutableCollection<in T>> toCollection(destination: C): C

Appends all elements to the given destination collection.

Link copied to clipboard
fun toList(): List<T>
Link copied to clipboard
fun <R> use(consumer: (Sequence<T>) -> R): R

Creates a new cursor and treats it as a Sequence, invokes the given consumer function and closes the cursor down correctly whether an exception is thrown or not.