aggregate

@JvmName(name = "aggregateAsDocument")
fun aggregate(pipeline: List<Bson>): AggregateFlow<Document>

Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as $currentOp and $listLocalSessions.

Return

an iterable containing the result of the aggregation operation

Parameters

pipeline

the aggregation pipeline

See also


inline fun <T : Any> aggregate(pipeline: List<Bson>): AggregateFlow<T>

Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as $currentOp and $listLocalSessions.

Return

an iterable containing the result of the aggregation operation

Parameters

T

the class to decode each document into

pipeline

the aggregation pipeline

See also


@JvmName(name = "aggregateAsDocumentWithSession")
fun aggregate(clientSession: ClientSession, pipeline: List<Bson>): AggregateFlow<Document>

Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as $currentOp and $listLocalSessions.

Return

an iterable containing the result of the aggregation operation

Parameters

clientSession

the client session with which to associate this operation

pipeline

the aggregation pipeline

See also


inline fun <T : Any> aggregate(clientSession: ClientSession, pipeline: List<Bson>): AggregateFlow<T>

Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as $currentOp and $listLocalSessions.

Return

an iterable containing the result of the aggregation operation

Parameters

T

the class to decode each document into

clientSession

the client session with which to associate this operation

pipeline

the aggregation pipeline

See also


fun <T : Any> aggregate(pipeline: List<Bson>, resultClass: Class<T>): AggregateFlow<T>

Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as $currentOp and $listLocalSessions.

Return

an iterable containing the result of the aggregation operation

Parameters

T

the class to decode each document into

pipeline

the aggregation pipeline

resultClass

the target document type of the iterable.

See also


fun <T : Any> aggregate(clientSession: ClientSession, pipeline: List<Bson>, resultClass: Class<T>): AggregateFlow<T>

Runs an aggregation framework pipeline on the database for pipeline stages that do not require an underlying collection, such as $currentOp and $listLocalSessions.

Return

an iterable containing the result of the aggregation operation

Parameters

T

the class to decode each document into

clientSession

the client session with which to associate this operation

pipeline

the aggregation pipeline

resultClass

the target document type of the iterable.

See also