Table of Contents

Method FirstAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

FirstAsync<TResult>(IAggregateFluent<TResult>, CancellationToken)

Returns the first document of the aggregate result.

public static Task<TResult> FirstAsync<TResult>(this IAggregateFluent<TResult> aggregate, CancellationToken cancellationToken = default)

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TResult>

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.