Method MapReduce
MapReduce<TResult>(BsonJavaScript, BsonJavaScript, MapReduceOptions<TDocument, TResult>, CancellationToken)
Executes a map-reduce command.
[Obsolete("Use Aggregation pipeline instead.")]
public virtual IAsyncCursor<TResult> MapReduce<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
- 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.")]
public virtual IAsyncCursor<TResult> MapReduce<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
- IAsyncCursor<TResult>
A cursor.
Type Parameters
TResult
The type of the result.