kmongo / org.litote.kmongo / com.mongodb.client.MongoCollection / aggregate

aggregate

fun <reified TResult : Any> MongoCollection<*>.aggregate(vararg pipeline: String): AggregateIterable<TResult> (source)
fun <reified TResult : Any> MongoCollection<*>.aggregate(vararg pipeline: Bson): AggregateIterable<TResult> (source)

Aggregates documents according to the specified aggregation pipeline.

Parameters

pipeline - the aggregate pipeline

Parameters

Return
an iterable containing the result of the aggregation operation

fun <reified TResult : Any> MongoCollection<*>.aggregate(clientSession: ClientSession, vararg pipeline: String): AggregateIterable<TResult> (source)
fun <reified TResult : Any> MongoCollection<*>.aggregate(clientSession: ClientSession, vararg pipeline: Bson): AggregateIterable<TResult> (source)

Aggregates documents according to the specified aggregation pipeline.

Parameters

clientSession - the client session with which to associate this operation

pipeline - the aggregate pipeline

Parameters

Return
an iterable containing the result of the aggregation operation