Table of Contents

Class AggregateToCollectionOperation

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

Represents an aggregate operation that writes the results to an output collection.

public class AggregateToCollectionOperation : IWriteOperation<BsonDocument>
Inheritance
AggregateToCollectionOperation
Implements
Inherited Members
Extension Methods

Constructors

AggregateToCollectionOperation(CollectionNamespace, IEnumerable<BsonDocument>, MessageEncoderSettings)

Initializes a new instance of the AggregateToCollectionOperation class.

public AggregateToCollectionOperation(CollectionNamespace collectionNamespace, IEnumerable<BsonDocument> pipeline, MessageEncoderSettings messageEncoderSettings)

Parameters

collectionNamespace CollectionNamespace

The collection namespace.

pipeline IEnumerable<BsonDocument>

The pipeline.

messageEncoderSettings MessageEncoderSettings

The message encoder settings.

AggregateToCollectionOperation(DatabaseNamespace, IEnumerable<BsonDocument>, MessageEncoderSettings)

Initializes a new instance of the AggregateToCollectionOperation class.

public AggregateToCollectionOperation(DatabaseNamespace databaseNamespace, IEnumerable<BsonDocument> pipeline, MessageEncoderSettings messageEncoderSettings)

Parameters

databaseNamespace DatabaseNamespace

The database namespace.

pipeline IEnumerable<BsonDocument>

The pipeline.

messageEncoderSettings MessageEncoderSettings

The message encoder settings.

Properties

AllowDiskUse

Gets or sets a value indicating whether the server is allowed to use the disk.

public bool? AllowDiskUse { get; set; }

Property Value

bool?

A value indicating whether the server is allowed to use the disk.

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.

Collation

Gets or sets the collation.

public Collation Collation { get; set; }

Property Value

Collation

The collation.

CollectionNamespace

Gets the collection namespace.

public CollectionNamespace CollectionNamespace { get; }

Property Value

CollectionNamespace

The collection namespace.

Comment

Gets or sets the comment.

public BsonValue Comment { get; set; }

Property Value

BsonValue

The comment.

DatabaseNamespace

Gets the database namespace.

public DatabaseNamespace DatabaseNamespace { get; }

Property Value

DatabaseNamespace

The database namespace.

Hint

Gets or sets the hint. This must either be a BsonString representing the index name or a BsonDocument representing the key pattern of the index.

public BsonValue Hint { get; set; }

Property Value

BsonValue

The hint.

Let

Gets or sets the "let" definition.

public BsonDocument Let { get; set; }

Property Value

BsonDocument

The "let" definition.

MaxTime

Gets or sets the maximum time the server should spend on this operation.

public TimeSpan? MaxTime { get; set; }

Property Value

TimeSpan?

The maximum time the server should spend on this operation.

MessageEncoderSettings

Gets the message encoder settings.

public MessageEncoderSettings MessageEncoderSettings { get; }

Property Value

MessageEncoderSettings

The message encoder settings.

Pipeline

Gets the pipeline.

public IReadOnlyList<BsonDocument> Pipeline { get; }

Property Value

IReadOnlyList<BsonDocument>

The pipeline.

ReadConcern

Gets or sets the read concern.

public ReadConcern ReadConcern { get; set; }

Property Value

ReadConcern

The read concern.

ReadPreference

Gets or sets the read preference.

public ReadPreference ReadPreference { get; set; }

Property Value

ReadPreference

WriteConcern

Gets or sets the write concern.

public WriteConcern WriteConcern { get; set; }

Property Value

WriteConcern

The write concern.

Methods

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.