MapReduceFlow

class MapReduceFlow<T : Any>(wrapped: MapReducePublisher<T>) : Flow<T>

Deprecated

Map Reduce has been deprecated. Use Aggregation instead

Replace with

Flow implementation for map reduce operations.

Note: Starting in MongoDB 5.0, map-reduce is deprecated, prefer Aggregation instead

Parameters

T

The type of the result.

See also

Constructors

Link copied to clipboard
constructor(wrapped: MapReducePublisher<T>)

Functions

Link copied to clipboard
fun action(action: MapReduceAction): MapReduceFlow<T>

Specify the MapReduceAction to be used when writing to a collection.

Link copied to clipboard
fun batchSize(batchSize: Int): MapReduceFlow<T>

Sets the number of documents to return per batch.

Link copied to clipboard
fun bypassDocumentValidation(bypassDocumentValidation: Boolean?): MapReduceFlow<T>

Sets the bypass document level validation flag.

Link copied to clipboard
fun collation(collation: Collation?): MapReduceFlow<T>

Sets the collation options

Link copied to clipboard
open suspend override fun collect(collector: FlowCollector<T>)
Link copied to clipboard
fun collectionName(collectionName: String): MapReduceFlow<T>

Sets the collectionName for the output of the MapReduce

Link copied to clipboard
fun databaseName(databaseName: String?): MapReduceFlow<T>

Sets the name of the database to output into.

Link copied to clipboard
fun filter(filter: Bson?): MapReduceFlow<T>

Sets the query filter to apply to the query.

Link copied to clipboard
fun finalizeFunction(finalizeFunction: String?): MapReduceFlow<T>

Sets the JavaScript function that follows the reduce method and modifies the output.

Link copied to clipboard
fun jsMode(jsMode: Boolean): MapReduceFlow<T>

Sets the flag that specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions. Defaults to false.

Link copied to clipboard
fun limit(limit: Int): MapReduceFlow<T>

Sets the limit to apply.

Link copied to clipboard
fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): MapReduceFlow<T>

Sets the maximum execution time on the server for this operation.

Link copied to clipboard
fun nonAtomic(nonAtomic: Boolean): MapReduceFlow<T>

Sets if the post-processing step will prevent MongoDB from locking the database.

Link copied to clipboard
fun scope(scope: Bson?): MapReduceFlow<T>

Sets the global variables that are accessible in the map, reduce and finalize functions.

Link copied to clipboard
fun sharded(sharded: Boolean): MapReduceFlow<T>

Sets if the output database is sharded

Link copied to clipboard
fun sort(sort: Bson?): MapReduceFlow<T>

Sets the sort criteria to apply to the query.

Link copied to clipboard
suspend fun toCollection()

Aggregates documents to a collection according to the specified map-reduce function with the given options, which must specify a non-inline result.

Link copied to clipboard
fun verbose(verbose: Boolean): MapReduceFlow<T>

Sets whether to include the timing information in the result information.