kmongo / org.litote.kmongo.coroutine / CoroutineCollection / mapReduce

mapReduce

fun <reified T : Any> mapReduce(mapFunction: String, reduceFunction: String): CoroutineMapReducePublisher<T> (source)

Aggregates documents according to the specified map-reduce function.

Parameters

mapFunction - A JavaScript function that associates or "maps" a value with a key and emits the key and value pair.

reduceFunction - A JavaScript function that "reduces" to a single object all the values associated with a particular key.

Parameters

Return
a publisher containing the result of the map-reduce operation

Mongodb
.driver.manual reference/command/mapReduce/ map-reduce

fun <reified T : Any> mapReduce(clientSession: ClientSession, mapFunction: String, reduceFunction: String): CoroutineMapReducePublisher<T> (source)

Aggregates documents according to the specified map-reduce function.

Parameters

clientSession - the client session with which to associate this operation

mapFunction - A JavaScript function that associates or "maps" a value with a key and emits the key and value pair.

reduceFunction - A JavaScript function that "reduces" to a single object all the values associated with a particular key.

Parameters

Return
a publisher containing the result of the map-reduce operation

Mongodb
.driver.manual reference/command/mapReduce/ map-reduce

Mongodb
.server.release 3.6

Since
1.7