fun <reified TResult : Any> MongoCollection<*>.mapReduceWith(mapFunction: String, reduceFunction: String): MapReduceIterable<TResult>
(source)
Aggregates documents according to the specified map-reduce function.
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
an iterable containing the result of the map-reduce operation
fun <reified TResult : Any> MongoCollection<*>.mapReduceWith(clientSession: ClientSession, mapFunction: String, reduceFunction: String): MapReduceIterable<TResult>
(source)
Aggregates documents according to the specified map-reduce function.
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
an iterable containing the result of the map-reduce operation