aggregate

abstract 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

Since

1.11

Parameters

pipeline

the aggregation pipeline


abstract fun <TResult : Any> aggregate(pipeline: List<Bson>, resultClass: KClass<out TResult>): AggregateFlow<TResult>

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

Since

1.11

Parameters

pipeline

the aggregation pipeline

resultClass

the class to decode each document into

the target document type of the iterable.

abstract 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

Since

1.11

Parameters

clientSession

the client session with which to associate this operation

pipeline

the aggregation pipeline


abstract fun <TResult : Any> aggregate(    clientSession: ClientSession,     pipeline: List<Bson>,     resultClass: KClass<out TResult>): AggregateFlow<TResult>

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

Since

1.11

Parameters

clientSession

the client session with which to associate this operation

pipeline

the aggregation pipeline

resultClass

the class to decode each document into

the target document type of the iterable.