Method AnyAsync

| MongoDB CSharp Driver API Reference (original) (raw)

Namespace

MongoDB.Driver

Assembly

MongoDB.Driver.dll

AnyAsync(IAsyncCursor, CancellationToken)

Determines whether the cursor contains any documents.

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

Parameters

cursor IAsyncCursor

The cursor.

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.