aggregate

inline fun <TResult : Any> MongoCollection<*>.aggregate(vararg pipeline: String): AggregateFlow<TResult>
inline fun <TResult : Any> MongoCollection<*>.aggregate(vararg pipeline: Bson): AggregateFlow<TResult>

Aggregates documents according to the specified aggregation pipeline.

Return

an iterable containing the result of the aggregation operation

Parameters

pipeline

the aggregate pipeline

the target document type of the iterable.

inline fun <TResult : Any> MongoCollection<*>.aggregate(clientSession: ClientSession, vararg pipeline: String): AggregateFlow<TResult>
inline fun <TResult : Any> MongoCollection<*>.aggregate(clientSession: ClientSession, vararg pipeline: Bson): AggregateFlow<TResult>

Aggregates documents according to the specified aggregation pipeline.

Return

an iterable containing the result of the aggregation operation

Parameters

clientSession

the client session with which to associate this operation

pipeline

the aggregate pipeline

the target document type of the iterable.