Table of Contents

Method AnyAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

AnyAsync<TDocument>(IAsyncCursorSource<TDocument>, CancellationToken)

Determines whether the cursor returned by a cursor source contains any documents.

public static Task<bool> AnyAsync<TDocument>(this IAsyncCursorSource<TDocument> source, CancellationToken cancellationToken = default)

Parameters

source IAsyncCursorSource<TDocument>

The source.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<bool>

A Task whose result is true if the cursor contains any documents.

Type Parameters

TDocument

The type of the document.