Table of Contents

Method CountAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

CountAsync(CancellationToken)

Counts the number of documents.

[Obsolete("Use CountDocumentsAsync instead.")]
public abstract Task<long> CountAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long>

A Task whose result is the count.