Table of Contents

Method FindAs

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.Legacy.dll

FindAs<TDocument>(IMongoQuery)

Returns a cursor that can be used to find all documents in this collection that match the query as TDocuments.

public virtual MongoCursor<TDocument> FindAs<TDocument>(IMongoQuery query)

Parameters

query IMongoQuery

The query (usually a QueryDocument or constructed using the Query builder).

Returns

MongoCursor<TDocument>

A MongoCursor<TDocument>.

Type Parameters

TDocument

The type to deserialize the documents as.

FindAs(Type, IMongoQuery)

Returns a cursor that can be used to find all documents in this collection that match the query as TDocuments.

public virtual MongoCursor FindAs(Type documentType, IMongoQuery query)

Parameters

documentType Type

The nominal type of the documents.

query IMongoQuery

The query (usually a QueryDocument or constructed using the Query builder).

Returns

MongoCursor

A MongoCursor<TDocument>.