toCollection

abstract suspend fun toCollection()

Aggregates documents according to the specified aggregation pipeline, which must end with a $out stage.

Return

a publisher with a single element indicating when the operation has completed