Table of Contents

Method MapReduce

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

MapReduce<TResult>(BsonJavaScript, BsonJavaScript, MapReduceOptions<TDocument, TResult>, CancellationToken)

Executes a map-reduce command.

[Obsolete("Use Aggregation pipeline instead.")]
IAsyncCursor<TResult> MapReduce<TResult>(BsonJavaScript map, BsonJavaScript reduce, MapReduceOptions<TDocument, TResult> options = null, CancellationToken cancellationToken = default)

Parameters

map BsonJavaScript

The map function.

reduce BsonJavaScript

The reduce function.

options MapReduceOptions<TDocument, TResult>

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncCursor<TResult>

A cursor.

Type Parameters

TResult

The type of the result.

MapReduce<TResult>(IClientSessionHandle, BsonJavaScript, BsonJavaScript, MapReduceOptions<TDocument, TResult>, CancellationToken)

Executes a map-reduce command.

[Obsolete("Use Aggregation pipeline instead.")]
IAsyncCursor<TResult> MapReduce<TResult>(IClientSessionHandle session, BsonJavaScript map, BsonJavaScript reduce, MapReduceOptions<TDocument, TResult> options = null, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

map BsonJavaScript

The map function.

reduce BsonJavaScript

The reduce function.

options MapReduceOptions<TDocument, TResult>

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncCursor<TResult>

A cursor.

Type Parameters

TResult

The type of the result.