mapReduce

abstract fun mapReduce(mapFunction: String, reduceFunction: String): MapReduceFlow<TDocument>

Aggregates documents according to the specified map-reduce function.

Return

an iterable containing the result of the map-reduce operation

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.


abstract fun <TResult : Any> mapReduce(    mapFunction: String,     reduceFunction: String,     resultClass: KClass<out TResult>): MapReduceFlow<TResult>

Aggregates documents according to the specified map-reduce function.

Return

an iterable containing the result of the map-reduce operation

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.

resultClass

the class to decode each resulting document into.

the target document type of the iterable.

abstract fun mapReduce(    clientSession: ClientSession,     mapFunction: String,     reduceFunction: String): MapReduceFlow<TDocument>

Aggregates documents according to the specified map-reduce function.

Return

an iterable containing the result of the map-reduce operation

Since

3.6

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.


abstract fun <TResult : Any> mapReduce(    clientSession: ClientSession,     mapFunction: String,     reduceFunction: String,     resultClass: KClass<out TResult>): MapReduceFlow<TResult>

Aggregates documents according to the specified map-reduce function.

Return

an iterable containing the result of the map-reduce operation

Since

3.6

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.

resultClass

the class to decode each resulting document into.

the target document type of the iterable.