Table of Contents

Method Find

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Find<TDocument>(IMongoCollection<TDocument>, FilterDefinition<TDocument>, FindOptions)

Begins a fluent find interface.

public static IFindFluent<TDocument, TDocument> Find<TDocument>(this IMongoCollection<TDocument> collection, FilterDefinition<TDocument> filter, FindOptions options = null)

Parameters

collection IMongoCollection<TDocument>

The collection.

filter FilterDefinition<TDocument>

The filter.

options FindOptions

The options.

Returns

IFindFluent<TDocument, TDocument>

A fluent find interface.

Type Parameters

TDocument

The type of the document.

Find<TDocument>(IMongoCollection<TDocument>, IClientSessionHandle, FilterDefinition<TDocument>, FindOptions)

Begins a fluent find interface.

public static IFindFluent<TDocument, TDocument> Find<TDocument>(this IMongoCollection<TDocument> collection, IClientSessionHandle session, FilterDefinition<TDocument> filter, FindOptions options = null)

Parameters

collection IMongoCollection<TDocument>

The collection.

session IClientSessionHandle

The session.

filter FilterDefinition<TDocument>

The filter.

options FindOptions

The options.

Returns

IFindFluent<TDocument, TDocument>

A fluent find interface.

Type Parameters

TDocument

The type of the document.

Find<TDocument>(IMongoCollection<TDocument>, Expression<Func<TDocument, bool>>, FindOptions)

Begins a fluent find interface.

public static IFindFluent<TDocument, TDocument> Find<TDocument>(this IMongoCollection<TDocument> collection, Expression<Func<TDocument, bool>> filter, FindOptions options = null)

Parameters

collection IMongoCollection<TDocument>

The collection.

filter Expression<Func<TDocument, bool>>

The filter.

options FindOptions

The options.

Returns

IFindFluent<TDocument, TDocument>

A fluent interface.

Type Parameters

TDocument

The type of the document.

Find<TDocument>(IMongoCollection<TDocument>, IClientSessionHandle, Expression<Func<TDocument, bool>>, FindOptions)

Begins a fluent find interface.

public static IFindFluent<TDocument, TDocument> Find<TDocument>(this IMongoCollection<TDocument> collection, IClientSessionHandle session, Expression<Func<TDocument, bool>> filter, FindOptions options = null)

Parameters

collection IMongoCollection<TDocument>

The collection.

session IClientSessionHandle

The session.

filter Expression<Func<TDocument, bool>>

The filter.

options FindOptions

The options.

Returns

IFindFluent<TDocument, TDocument>

A fluent interface.

Type Parameters

TDocument

The type of the document.