Table of Contents

Method AsQueryable

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

AsQueryable<TDocument>(IMongoCollection<TDocument>, AggregateOptions)

Creates a queryable source of documents.

public static IMongoQueryable<TDocument> AsQueryable<TDocument>(this IMongoCollection<TDocument> collection, AggregateOptions aggregateOptions = null)

Parameters

collection IMongoCollection<TDocument>

The collection.

aggregateOptions AggregateOptions

The aggregate options

Returns

IMongoQueryable<TDocument>

A queryable source of documents.

Type Parameters

TDocument

The type of the document.

AsQueryable<TDocument>(IMongoCollection<TDocument>, IClientSessionHandle, AggregateOptions)

Creates a queryable source of documents.

public static IMongoQueryable<TDocument> AsQueryable<TDocument>(this IMongoCollection<TDocument> collection, IClientSessionHandle session, AggregateOptions aggregateOptions = null)

Parameters

collection IMongoCollection<TDocument>

The collection.

session IClientSessionHandle

The session.

aggregateOptions AggregateOptions

The aggregate options

Returns

IMongoQueryable<TDocument>

A queryable source of documents.

Type Parameters

TDocument

The type of the document.