MongoDB .NET Driver API Documentation

## IMongoQueryableT Methods |

The IMongoQueryableT generic type exposes the following members.

Methods

Name | Description | |
---|---|---|

GetEnumerator | Returns an enumerator that iterates through a collection. (Inherited from IEnumerable.) | |

GetExecutionModel |
Gets the execution model.
(Inherited from IMongoQueryable.) | |

ToCursor |
Executes the operation and returns a cursor to the results.
(Inherited from IAsyncCursorSourceTDocument.) | |

ToCursorAsync |
Executes the operation and returns a cursor to the results.
(Inherited from IAsyncCursorSourceTDocument.) |

Extension Methods

Name | Description | |
---|---|---|

AnyT |
Determines whether the cursor returned by a cursor source contains any documents.
(Defined by IAsyncCursorSourceExtensions.) | |

AnyAsyncT(CancellationToken) | Overloaded.
Determines whether the cursor returned by a cursor source contains any documents.
(Defined by IAsyncCursorSourceExtensions.) | |

AnyAsyncTSource(CancellationToken) | Overloaded.
Determines whether a sequence contains any elements.
(Defined by MongoQueryable.) | |

AnyAsyncTSource(ExpressionFuncTSource, Boolean, CancellationToken) | Overloaded.
Determines whether any element of a sequence satisfies a condition.
(Defined by MongoQueryable.) | |

AverageAsyncTSource(ExpressionFuncTSource, Decimal, CancellationToken) | Overloaded.
Computes the average of the sequence of Decimal values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

AverageAsyncTSource(ExpressionFuncTSource, NullableDecimal, CancellationToken) | Overloaded.
Computes the average of the sequence of NullableT values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

AverageAsyncTSource(ExpressionFuncTSource, Double, CancellationToken) | Overloaded.
Computes the average of the sequence of Double values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

AverageAsyncTSource(ExpressionFuncTSource, NullableDouble, CancellationToken) | Overloaded.
Computes the average of the sequence of NullableT values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

AverageAsyncTSource(ExpressionFuncTSource, Single, CancellationToken) | Overloaded.
Computes the average of the sequence of Single values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

AverageAsyncTSource(ExpressionFuncTSource, NullableSingle, CancellationToken) | Overloaded.
Computes the average of the sequence of NullableT values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

AverageAsyncTSource(ExpressionFuncTSource, Int32, CancellationToken) | Overloaded.
Computes the average of the sequence of Int32 values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

AverageAsyncTSource(ExpressionFuncTSource, NullableInt32, CancellationToken) | Overloaded. | |

AverageAsyncTSource(ExpressionFuncTSource, Int64, CancellationToken) | Overloaded.
Computes the average of the sequence of Int64 values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

AverageAsyncTSource(ExpressionFuncTSource, NullableInt64, CancellationToken) | Overloaded. | |

ContainsAllT |
Determines whether a sequence contains all of the specified values.
(Defined by LinqToMongo.) | |

ContainsAnyT |
Determines whether a sequence contains any of the specified values.
(Defined by LinqToMongo.) | |

CountAsyncTSource(CancellationToken) | Overloaded.
Returns the number of elements in a sequence.
(Defined by MongoQueryable.) | |

CountAsyncTSource(ExpressionFuncTSource, Boolean, CancellationToken) | Overloaded.
Returns the number of elements in the specified sequence that satisfies a condition.
(Defined by MongoQueryable.) | |

DistinctTSource |
Returns distinct elements from a sequence by using the default equality comparer to compare values.
(Defined by MongoQueryable.) | |

ExplainT | Overloaded.
Returns an explanation of how the query was executed (instead of the results).
(Defined by LinqExtensionMethods.) | |

ExplainT(Boolean) | Overloaded.
Returns an explanation of how the query was executed (instead of the results).
(Defined by LinqExtensionMethods.) | |

FirstT |
Returns the first document of a cursor returned by a cursor source.
(Defined by IAsyncCursorSourceExtensions.) | |

FirstAsyncT(CancellationToken) | Overloaded.
Returns the first document of a cursor returned by a cursor source.
(Defined by IAsyncCursorSourceExtensions.) | |

FirstAsyncTSource(CancellationToken) | Overloaded.
Returns the first element of a sequence.
(Defined by MongoQueryable.) | |

FirstAsyncTSource(ExpressionFuncTSource, Boolean, CancellationToken) | Overloaded.
Returns the first element of a sequence that satisfies a specified condition.
(Defined by MongoQueryable.) | |

FirstOrDefaultT |
Returns the first document of a cursor returned by a cursor source, or a default value if the cursor contains no documents.
(Defined by IAsyncCursorSourceExtensions.) | |

FirstOrDefaultAsyncT(CancellationToken) | Overloaded.
Returns the first document of a cursor returned by a cursor source, or a default value if the cursor contains no documents.
(Defined by IAsyncCursorSourceExtensions.) | |

FirstOrDefaultAsyncTSource(CancellationToken) | Overloaded.
Returns the first element of a sequence, or a default value if the sequence contains no elements.
(Defined by MongoQueryable.) | |

FirstOrDefaultAsyncTSource(ExpressionFuncTSource, Boolean, CancellationToken) | Overloaded.
Returns the first element of a sequence that satisfies a specified condition or a default value if no such element is found.
(Defined by MongoQueryable.) | |

ForEachAsyncT(FuncT, Task, CancellationToken) | Overloaded.
Calls a delegate for each document returned by the cursor.
(Defined by IAsyncCursorSourceExtensions.) | |

ForEachAsyncT(FuncT, Int32, Task, CancellationToken) | Overloaded.
Calls a delegate for each document returned by the cursor.
(Defined by IAsyncCursorSourceExtensions.) | |

ForEachAsyncT(ActionT, CancellationToken) | Overloaded.
Calls a delegate for each document returned by the cursor.
(Defined by IAsyncCursorSourceExtensions.) | |

ForEachAsyncT(ActionT, Int32, CancellationToken) | Overloaded.
Calls a delegate for each document returned by the cursor.
(Defined by IAsyncCursorSourceExtensions.) | |

GroupByTSource, TKey(ExpressionFuncTSource, TKey) | Overloaded.
Groups the elements of a sequence according to a specified key selector function.
(Defined by MongoQueryable.) | |

GroupByTSource, TKey, TResult(ExpressionFuncTSource, TKey, ExpressionFuncTKey, IEnumerableTSource, TResult) | Overloaded.
Groups the elements of a sequence according to a specified key selector function
and creates a result value from each group and its key.
(Defined by MongoQueryable.) | |

GroupJoinTOuter, TInner, TKey, TResult(IEnumerableTInner, ExpressionFuncTOuter, TKey, ExpressionFuncTInner, TKey, ExpressionFuncTOuter, IEnumerableTInner, TResult) | Overloaded.
Correlates the elements of two sequences based on key equality and groups the results.
(Defined by MongoQueryable.) | |

GroupJoinTOuter, TInner, TKey, TResult(IMongoCollectionTInner, ExpressionFuncTOuter, TKey, ExpressionFuncTInner, TKey, ExpressionFuncTOuter, IEnumerableTInner, TResult) | Overloaded.
Correlates the elements of two sequences based on key equality and groups the results.
(Defined by MongoQueryable.) | |

JoinTOuter, TInner, TKey, TResult(IEnumerableTInner, ExpressionFuncTOuter, TKey, ExpressionFuncTInner, TKey, ExpressionFuncTOuter, TInner, TResult) | Overloaded.
Correlates the elements of two sequences based on matching keys.
(Defined by MongoQueryable.) | |

JoinTOuter, TInner, TKey, TResult(IMongoCollectionTInner, ExpressionFuncTOuter, TKey, ExpressionFuncTInner, TKey, ExpressionFuncTOuter, TInner, TResult) | Overloaded.
Correlates the elements of two sequences based on matching keys.
(Defined by MongoQueryable.) | |

LongCountAsyncTSource(CancellationToken) | Overloaded.
Returns the number of elements in a sequence.
(Defined by MongoQueryable.) | |

LongCountAsyncTSource(ExpressionFuncTSource, Boolean, CancellationToken) | Overloaded.
Returns the number of elements in the specified sequence that satisfies a condition.
(Defined by MongoQueryable.) | |

MaxAsyncTSource(CancellationToken) | Overloaded.
Returns the maximum value in a generic IMongoQueryableT.
(Defined by MongoQueryable.) | |

MaxAsyncTSource, TResult(ExpressionFuncTSource, TResult, CancellationToken) | Overloaded.
Invokes a projection function on each element of a generic IMongoQueryableT and returns the maximum resulting value.
(Defined by MongoQueryable.) | |

MinAsyncTSource(CancellationToken) | Overloaded.
Returns the minimum value in a generic IMongoQueryableT.
(Defined by MongoQueryable.) | |

MinAsyncTSource, TResult(ExpressionFuncTSource, TResult, CancellationToken) | Overloaded.
Invokes a projection function on each element of a generic IMongoQueryableT and returns the minimum resulting value.
(Defined by MongoQueryable.) | |

OfTypeTResult |
Filters the elements of an IMongoQueryable based on a specified type.
(Defined by MongoQueryable.) | |

OrderByTSource, TKey |
Sorts the elements of a sequence in ascending order according to a key.
(Defined by MongoQueryable.) | |

OrderByDescendingTSource, TKey |
Sorts the elements of a sequence in descending order according to a key.
(Defined by MongoQueryable.) | |

SampleTSource |
Returns a sample of the elements in the source.
(Defined by MongoQueryable.) | |

SelectTSource, TResult |
Projects each element of a sequence into a new form by incorporating the
element's index.
(Defined by MongoQueryable.) | |

SelectManyTSource, TResult(ExpressionFuncTSource, IEnumerableTResult) | Overloaded.
Projects each element of a sequence to an IEnumerableT and combines the resulting sequences into one sequence.
(Defined by MongoQueryable.) | |

SelectManyTSource, TCollection, TResult(ExpressionFuncTSource, IEnumerableTCollection, ExpressionFuncTSource, TCollection, TResult) | Overloaded.
Projects each element of a sequence to an IEnumerableT and
invokes a result selector function on each element therein. The resulting values from
each intermediate sequence are combined into a single, one-dimensional sequence and returned.
(Defined by MongoQueryable.) | |

SingleT |
Returns the only document of a cursor returned by a cursor source. This method throws an exception if the cursor does not contain exactly one document.
(Defined by IAsyncCursorSourceExtensions.) | |

SingleAsyncT(CancellationToken) | Overloaded.
Returns the only document of a cursor returned by a cursor source. This method throws an exception if the cursor does not contain exactly one document.
(Defined by IAsyncCursorSourceExtensions.) | |

SingleAsyncTSource(CancellationToken) | Overloaded.
Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.
(Defined by MongoQueryable.) | |

SingleAsyncTSource(ExpressionFuncTSource, Boolean, CancellationToken) | Overloaded.
Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.
(Defined by MongoQueryable.) | |

SingleOrDefaultT |
Returns the only document of a cursor returned by a cursor source, or a default value if the cursor contains no documents.
This method throws an exception if the cursor contains more than one document.
(Defined by IAsyncCursorSourceExtensions.) | |

SingleOrDefaultAsyncT(CancellationToken) | Overloaded.
Returns the only document of a cursor returned by a cursor source, or a default value if the cursor contains no documents.
This method throws an exception if the cursor contains more than one document.
(Defined by IAsyncCursorSourceExtensions.) | |

SingleOrDefaultAsyncTSource(CancellationToken) | Overloaded.
Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.
(Defined by MongoQueryable.) | |

SingleOrDefaultAsyncTSource(ExpressionFuncTSource, Boolean, CancellationToken) | Overloaded.
Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
(Defined by MongoQueryable.) | |

SkipTSource |
Bypasses a specified number of elements in a sequence and then returns the
remaining elements.
(Defined by MongoQueryable.) | |

StandardDeviationPopulationT(FuncT, Int32) | Overloaded.
Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
(Defined by MongoEnumerable.) | |

StandardDeviationPopulationT(FuncT, NullableInt32) | Overloaded.
Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
(Defined by MongoEnumerable.) | |

StandardDeviationPopulationT(FuncT, Int64) | Overloaded.
Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
(Defined by MongoEnumerable.) | |

StandardDeviationPopulationT(FuncT, NullableInt64) | Overloaded. | |

StandardDeviationPopulationT(FuncT, Single) | Overloaded. | |

StandardDeviationPopulationT(FuncT, NullableSingle) | Overloaded. | |

StandardDeviationPopulationT(FuncT, Double) | Overloaded. | |

StandardDeviationPopulationT(FuncT, NullableDouble) | Overloaded. | |

StandardDeviationPopulationT(FuncT, Decimal) | Overloaded. | |

StandardDeviationPopulationT(FuncT, NullableDecimal) | Overloaded. | |

StandardDeviationPopulationTSource(ExpressionFuncTSource, Int32) | Overloaded. | |

StandardDeviationPopulationTSource(ExpressionFuncTSource, NullableInt32) | Overloaded. | |

StandardDeviationPopulationTSource(ExpressionFuncTSource, Int64) | Overloaded. | |

StandardDeviationPopulationTSource(ExpressionFuncTSource, NullableInt64) | Overloaded. | |

StandardDeviationPopulationTSource(ExpressionFuncTSource, Single) | Overloaded. | |

StandardDeviationPopulationTSource(ExpressionFuncTSource, NullableSingle) | Overloaded. | |

StandardDeviationPopulationTSource(ExpressionFuncTSource, Double) | Overloaded. | |

StandardDeviationPopulationTSource(ExpressionFuncTSource, NullableDouble) | Overloaded. | |

StandardDeviationPopulationTSource(ExpressionFuncTSource, Decimal) | Overloaded. | |

StandardDeviationPopulationTSource(ExpressionFuncTSource, NullableDecimal) | Overloaded. | |

StandardDeviationPopulationAsyncTSource(ExpressionFuncTSource, Int32, CancellationToken) | Overloaded. | |

StandardDeviationPopulationAsyncTSource(ExpressionFuncTSource, NullableInt32, CancellationToken) | Overloaded. | |

StandardDeviationPopulationAsyncTSource(ExpressionFuncTSource, Int64, CancellationToken) | Overloaded. | |

StandardDeviationPopulationAsyncTSource(ExpressionFuncTSource, NullableInt64, CancellationToken) | Overloaded. | |

StandardDeviationPopulationAsyncTSource(ExpressionFuncTSource, Single, CancellationToken) | Overloaded. | |

StandardDeviationPopulationAsyncTSource(ExpressionFuncTSource, NullableSingle, CancellationToken) | Overloaded. | |

StandardDeviationPopulationAsyncTSource(ExpressionFuncTSource, Double, CancellationToken) | Overloaded. | |

StandardDeviationPopulationAsyncTSource(ExpressionFuncTSource, NullableDouble, CancellationToken) | Overloaded. | |

StandardDeviationPopulationAsyncTSource(ExpressionFuncTSource, Decimal, CancellationToken) | Overloaded. | |

StandardDeviationPopulationAsyncTSource(ExpressionFuncTSource, NullableDecimal, CancellationToken) | Overloaded. | |

StandardDeviationSampleT(FuncT, Int32) | Overloaded.
Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
(Defined by MongoEnumerable.) | |

StandardDeviationSampleT(FuncT, NullableInt32) | Overloaded.
Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
(Defined by MongoEnumerable.) | |

StandardDeviationSampleT(FuncT, Int64) | Overloaded.
Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
(Defined by MongoEnumerable.) | |

StandardDeviationSampleT(FuncT, NullableInt64) | Overloaded. | |

StandardDeviationSampleT(FuncT, Single) | Overloaded. | |

StandardDeviationSampleT(FuncT, NullableSingle) | Overloaded. | |

StandardDeviationSampleT(FuncT, Double) | Overloaded. | |

StandardDeviationSampleT(FuncT, NullableDouble) | Overloaded. | |

StandardDeviationSampleT(FuncT, Decimal) | Overloaded. | |

StandardDeviationSampleT(FuncT, NullableDecimal) | Overloaded. | |

StandardDeviationSampleTSource(ExpressionFuncTSource, Int32) | Overloaded. | |

StandardDeviationSampleTSource(ExpressionFuncTSource, NullableInt32) | Overloaded. | |

StandardDeviationSampleTSource(ExpressionFuncTSource, Int64) | Overloaded. | |

StandardDeviationSampleTSource(ExpressionFuncTSource, NullableInt64) | Overloaded. | |

StandardDeviationSampleTSource(ExpressionFuncTSource, Single) | Overloaded. | |

StandardDeviationSampleTSource(ExpressionFuncTSource, NullableSingle) | Overloaded. | |

StandardDeviationSampleTSource(ExpressionFuncTSource, Double) | Overloaded. | |

StandardDeviationSampleTSource(ExpressionFuncTSource, NullableDouble) | Overloaded. | |

StandardDeviationSampleTSource(ExpressionFuncTSource, Decimal) | Overloaded. | |

StandardDeviationSampleTSource(ExpressionFuncTSource, NullableDecimal) | Overloaded. | |

StandardDeviationSampleAsyncTSource(ExpressionFuncTSource, Int32, CancellationToken) | Overloaded. | |

StandardDeviationSampleAsyncTSource(ExpressionFuncTSource, NullableInt32, CancellationToken) | Overloaded. | |

StandardDeviationSampleAsyncTSource(ExpressionFuncTSource, Int64, CancellationToken) | Overloaded. | |

StandardDeviationSampleAsyncTSource(ExpressionFuncTSource, NullableInt64, CancellationToken) | Overloaded. | |

StandardDeviationSampleAsyncTSource(ExpressionFuncTSource, Single, CancellationToken) | Overloaded. | |

StandardDeviationSampleAsyncTSource(ExpressionFuncTSource, NullableSingle, CancellationToken) | Overloaded. | |

StandardDeviationSampleAsyncTSource(ExpressionFuncTSource, Double, CancellationToken) | Overloaded. | |

StandardDeviationSampleAsyncTSource(ExpressionFuncTSource, NullableDouble, CancellationToken) | Overloaded. | |

StandardDeviationSampleAsyncTSource(ExpressionFuncTSource, Decimal, CancellationToken) | Overloaded. | |

StandardDeviationSampleAsyncTSource(ExpressionFuncTSource, NullableDecimal, CancellationToken) | Overloaded. | |

SumAsyncTSource(ExpressionFuncTSource, Decimal, CancellationToken) | Overloaded.
Computes the sum of the sequence of Decimal values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

SumAsyncTSource(ExpressionFuncTSource, NullableDecimal, CancellationToken) | Overloaded.
Computes the sum of the sequence of NullableT values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

SumAsyncTSource(ExpressionFuncTSource, Double, CancellationToken) | Overloaded.
Computes the sum of the sequence of Double values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

SumAsyncTSource(ExpressionFuncTSource, NullableDouble, CancellationToken) | Overloaded.
Computes the sum of the sequence of NullableT values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

SumAsyncTSource(ExpressionFuncTSource, Single, CancellationToken) | Overloaded.
Computes the sum of the sequence of Single values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

SumAsyncTSource(ExpressionFuncTSource, NullableSingle, CancellationToken) | Overloaded.
Computes the sum of the sequence of NullableT values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

SumAsyncTSource(ExpressionFuncTSource, Int32, CancellationToken) | Overloaded.
Computes the sum of the sequence of Int32 values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

SumAsyncTSource(ExpressionFuncTSource, NullableInt32, CancellationToken) | Overloaded. | |

SumAsyncTSource(ExpressionFuncTSource, Int64, CancellationToken) | Overloaded.
Computes the sum of the sequence of Int64 values that is obtained
by invoking a projection function on each element of the input sequence.
(Defined by MongoQueryable.) | |

SumAsyncTSource(ExpressionFuncTSource, NullableInt64, CancellationToken) | Overloaded. | |

TakeTSource |
Returns a specified number of contiguous elements from the start of a sequence.
(Defined by MongoQueryable.) | |

ToEnumerableT |
Wraps a cursor source in an IEnumerable. Each time GetEnumerator is called a new cursor is fetched from the cursor source.
(Defined by IAsyncCursorSourceExtensions.) | |

ToListT |
Returns a list containing all the documents returned by the cursor returned by a cursor source.
(Defined by IAsyncCursorSourceExtensions.) | |

ToListAsyncT |
Returns a list containing all the documents returned by the cursor returned by a cursor source.
(Defined by IAsyncCursorSourceExtensions.) | |

WhereTSource |
Filters a sequence of values based on a predicate.
(Defined by MongoQueryable.) | |

WithIndexT(String) | Overloaded.
Sets an index hint on the query that's being built.
(Defined by LinqToMongo.) | |

WithIndexT(BsonDocument) | Overloaded.
Sets an index hint on the query that's being built.
(Defined by LinqToMongo.) |

See Also