Table of Contents

Class EstimatedDocumentCountOperation

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

Represents an estimated document count operation.

public class EstimatedDocumentCountOperation : IReadOperation<long>
Inheritance
EstimatedDocumentCountOperation
Implements
Inherited Members
Extension Methods

Constructors

EstimatedDocumentCountOperation(CollectionNamespace, MessageEncoderSettings)

Initializes a new instance of the EstimatedDocumentCountOperation class.

public EstimatedDocumentCountOperation(CollectionNamespace collectionNamespace, MessageEncoderSettings messageEncoderSettings)

Parameters

collectionNamespace CollectionNamespace

The collection namespace.

messageEncoderSettings MessageEncoderSettings

The message encoder settings.

Properties

CollectionNamespace

Gets the collection namespace.

public CollectionNamespace CollectionNamespace { get; }

Property Value

CollectionNamespace

Comment

Gets or sets the comment.

public BsonValue Comment { get; set; }

Property Value

BsonValue

MaxTime

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

public TimeSpan? MaxTime { get; set; }

Property Value

TimeSpan?

MessageEncoderSettings

Gets the message encoder settings.

public MessageEncoderSettings MessageEncoderSettings { get; }

Property Value

MessageEncoderSettings

ReadConcern

Gets or sets the read concern.

public ReadConcern ReadConcern { get; set; }

Property Value

ReadConcern

RetryRequested

Gets or sets a value indicating whether to retry.

public bool RetryRequested { get; set; }

Property Value

bool

Methods

Execute(IReadBinding, CancellationToken)

Executes the operation.

public long Execute(IReadBinding binding, CancellationToken cancellationToken)

Parameters

binding IReadBinding

The binding.

cancellationToken CancellationToken

The cancellation token.

Returns

long

The result of the operation.

ExecuteAsync(IReadBinding, CancellationToken)

Executes the operation.

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

Parameters

binding IReadBinding

The binding.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long>

A Task whose result is the result of the operation.