Click or drag to resize

MongoCollectionBase<TDocument>.FindAsync<TProjection> Method (FilterDefinition<TDocument>, FindOptions<TDocument, TProjection>, CancellationToken)

Finds the documents matching the filter.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.11.0+cb27a82ea70620ad1acad8058809be8302ae4f2a
Syntax
public abstract Task<IAsyncCursor<TProjection>> FindAsync<TProjection>(
	FilterDefinition<TDocument> filter,
	FindOptions<TDocument, TProjection> options = null,
	CancellationToken cancellationToken = null
)

Parameters

filter
Type: MongoDB.Driver.FilterDefinition<TDocument>
The filter.
options (Optional)
Type: MongoDB.Driver.FindOptions<TDocument, TProjection>
The options.
cancellationToken (Optional)
Type: System.Threading.CancellationToken
The cancellation token.

Type Parameters

TProjection
The type of the projection (same as TDocument if there is no projection).

Return Value

Type: Task<IAsyncCursor<TProjection>>
A Task whose result is a cursor.

Implements

IMongoCollection<TDocument>.FindAsync<TProjection>(FilterDefinition<TDocument>, FindOptions<TDocument, TProjection>, CancellationToken)
See Also