Method MapReduceAsync
MapReduceAsync<TResult>(BsonJavaScript, BsonJavaScript, MapReduceOptions<TDocument, TResult>, CancellationToken)
Executes a map-reduce command.
[Obsolete("Use Aggregation pipeline instead.")]
Task<IAsyncCursor<TResult>> MapReduceAsync<TResult>(BsonJavaScript map, BsonJavaScript reduce, MapReduceOptions<TDocument, TResult> options = null, CancellationToken cancellationToken = default)
Parameters
map
BsonJavaScriptThe map function.
reduce
BsonJavaScriptThe reduce function.
options
MapReduceOptions<TDocument, TResult>The options.
cancellationToken
CancellationTokenThe 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.")]
Task<IAsyncCursor<TResult>> MapReduceAsync<TResult>(IClientSessionHandle session, BsonJavaScript map, BsonJavaScript reduce, MapReduceOptions<TDocument, TResult> options = null, CancellationToken cancellationToken = default)
Parameters
session
IClientSessionHandleThe session.
map
BsonJavaScriptThe map function.
reduce
BsonJavaScriptThe reduce function.
options
MapReduceOptions<TDocument, TResult>The options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<IAsyncCursor<TResult>>
A Task whose result is a cursor.
Type Parameters
TResult
The type of the result.