Table of Contents

Class MapReduceOutputToCollectionOperation

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

Represents a map-reduce operation that outputs its results to a collection.

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

Constructors

MapReduceOutputToCollectionOperation(CollectionNamespace, CollectionNamespace, BsonJavaScript, BsonJavaScript, MessageEncoderSettings)

Initializes a new instance of the MapReduceOutputToCollectionOperation class.

public MapReduceOutputToCollectionOperation(CollectionNamespace collectionNamespace, CollectionNamespace outputCollectionNamespace, BsonJavaScript mapFunction, BsonJavaScript reduceFunction, MessageEncoderSettings messageEncoderSettings)

Parameters

collectionNamespace CollectionNamespace

The collection namespace.

outputCollectionNamespace CollectionNamespace

The output collection namespace.

mapFunction BsonJavaScript

The map function.

reduceFunction BsonJavaScript

The reduce function.

messageEncoderSettings MessageEncoderSettings

The message encoder settings.

Properties

BypassDocumentValidation

Gets or sets a value indicating whether to bypass document validation.

public bool? BypassDocumentValidation { get; set; }

Property Value

bool?

A value indicating whether to bypass document validation.

NonAtomicOutput

Gets or sets a value indicating whether the server should not lock the database for merge and reduce output modes.

[Obsolete("NonAtomicOutput is rejected by server versions 4.4.0 and newer.")]
public bool? NonAtomicOutput { get; set; }

Property Value

bool?

true if the server should not lock the database for merge and reduce output modes; otherwise, false.

OutputCollectionNamespace

Gets the output collection namespace.

public CollectionNamespace OutputCollectionNamespace { get; }

Property Value

CollectionNamespace

The output collection namespace.

OutputMode

Gets or sets the output mode.

public MapReduceOutputMode OutputMode { get; set; }

Property Value

MapReduceOutputMode

The output mode.

ShardedOutput

Gets or sets a value indicating whether the output collection should be sharded.

[Obsolete("ShardedOutput is rejected by server versions 4.4.0 and newer.")]
public bool? ShardedOutput { get; set; }

Property Value

bool?

true if the output collection should be sharded; otherwise, false.

WriteConcern

Gets or sets the write concern.

public WriteConcern WriteConcern { get; set; }

Property Value

WriteConcern

The write 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(IWriteBinding, CancellationToken)

Executes the operation.

public BsonDocument Execute(IWriteBinding binding, CancellationToken cancellationToken)

Parameters

binding IWriteBinding

The binding.

cancellationToken CancellationToken

The cancellation token.

Returns

BsonDocument

The result of the operation.

ExecuteAsync(IWriteBinding, CancellationToken)

Executes the operation.

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

Parameters

binding IWriteBinding

The binding.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<BsonDocument>

A Task whose result is the result of the operation.