Table of Contents

Class MapReduceLegacyOperation

Namespace
MongoDB.Driver.Core.Operations
Assembly
MongoDB.Driver.Core.dll

Represents a map-reduce operation.

[Obsolete("Use Aggregation pipeline instead.")]
public class MapReduceLegacyOperation : MapReduceOperationBase, IReadOperation<BsonDocument>
Inheritance
MapReduceLegacyOperation
Implements
Inherited Members
Extension Methods

Constructors

MapReduceLegacyOperation(CollectionNamespace, BsonJavaScript, BsonJavaScript, MessageEncoderSettings)

Initializes a new instance of the MapReduceLegacyOperation class.

public MapReduceLegacyOperation(CollectionNamespace collectionNamespace, BsonJavaScript mapFunction, BsonJavaScript reduceFunction, MessageEncoderSettings messageEncoderSettings)

Parameters

collectionNamespace CollectionNamespace

The collection namespace.

mapFunction BsonJavaScript

The map function.

reduceFunction BsonJavaScript

The reduce function.

messageEncoderSettings MessageEncoderSettings

The message encoder settings.

Properties

ReadConcern

Gets or sets the read concern.

public ReadConcern ReadConcern { get; set; }

Property Value

ReadConcern

The read concern.

Methods

CreateCommand(ICoreSessionHandle, ConnectionDescription)

Creates the command.

protected override BsonDocument CreateCommand(ICoreSessionHandle session, ConnectionDescription connectionDescription)

Parameters

session ICoreSessionHandle

The session.

connectionDescription ConnectionDescription

The connection description.

Returns

BsonDocument

The command.

CreateOutputOptions()

Creates the output options.

protected override BsonDocument CreateOutputOptions()

Returns

BsonDocument

The output options.

Execute(IReadBinding, CancellationToken)

Executes the operation.

public BsonDocument Execute(IReadBinding binding, CancellationToken cancellationToken)

Parameters

binding IReadBinding

The binding.

cancellationToken CancellationToken

The cancellation token.

Returns

BsonDocument

The result of the operation.

ExecuteAsync(IReadBinding, CancellationToken)

Executes the operation.

public Task<BsonDocument> ExecuteAsync(IReadBinding binding, CancellationToken cancellationToken)

Parameters

binding IReadBinding

The binding.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<BsonDocument>

A Task whose result is the result of the operation.