Table of Contents

Method EstimatedDocumentCountAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

EstimatedDocumentCountAsync(EstimatedDocumentCountOptions, CancellationToken)

Returns an estimate of the number of documents in the collection.

public virtual Task<long> EstimatedDocumentCountAsync(EstimatedDocumentCountOptions options = null, CancellationToken cancellationToken = default)

Parameters

options EstimatedDocumentCountOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long>

An estimate of the number of documents in the collection.