suspend fun toCollection(): <ERROR CLASS>
(source)
Aggregates documents to a collection according to the specified map-reduce function with the given options, which must specify a non-inline result.
Return
a single element indicating when the operation has completed
Mongodb
.driver.manual aggregation/ Aggregation