Table of Contents

Method MapReduceAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

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

Executes a map-reduce command.

[Obsolete("Use Aggregation pipeline instead.")]
public abstract Task<IAsyncCursor<TResult>> MapReduceAsync<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

Task<IAsyncCursor<TResult>>

A Task whose result is a cursor.

Type Parameters

TResult

The type of the result.

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

Executes a map-reduce command.

[Obsolete("Use Aggregation pipeline instead.")]
public virtual Task<IAsyncCursor<TResult>> MapReduceAsync<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

Task<IAsyncCursor<TResult>>

A Task whose result is a cursor.

Type Parameters

TResult

The type of the result.