Skip to content

MongoDB driver for Kotlin (coroutines)opensavvy.ktmongo.coroutinesMongoAggregationPipeline

MongoAggregationPipeline

class MongoAggregationPipeline<Output : Any> : LazyMongoIterable<Output> 

Functions

asFlow

open override fun asFlow(): <Document>

Streams the results of this response into a Flow.

asIterable

open override fun asIterable(): MongoIterable<Output>

asSequence

open fun asSequence(): <Document>

embedInUnionWith

open fun embedInUnionWith(writer: ): 

first

open suspend fun first(): Output

Returns the first document found by this query, or throws an exception.

firstOrNull

open suspend override fun firstOrNull(): Output?

Returns the first document found by this query, or null if none were found.

forEach

open suspend override fun forEach(action: suspend (Output) -> Unit)

Executes action for each document returned by this query.

limit

match

open fun match(filter: <Output>.() -> Unit): MongoAggregationPipeline<Output>

project

open fun project(block: <Output>.() -> Unit): MongoAggregationPipeline<Output>

reinterpret

sample

set

open fun set(block: <Output>.() -> Unit): MongoAggregationPipeline<Output>

skip

open fun skip(amount: Int): MongoAggregationPipeline<Output>

sort

open fun sort(block: <Output>.() -> Unit): MongoAggregationPipeline<Output>

toList

open suspend fun toList(): List<Output>

Reads the entirety of this response into a List.

toSequence

open fun toSequence(): <Document>

toSet

open suspend fun toSet(): Set<Output>

Reads the entirety of this response into a Set.

unionWith

unset

open fun unset(block: <Output>.() -> Unit): MongoAggregationPipeline<Output>

withStage