Table of Contents

Class MongoQueryable

Namespace
MongoDB.Driver.Linq
Assembly
MongoDB.Driver.dll

Extension for IMongoQueryable.

public static class MongoQueryable
Inheritance
MongoQueryable
Inherited Members

Methods

AnyAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Determines whether any element of a sequence satisfies a condition.

public static Task<bool> AnyAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence whose elements to test for a condition.

predicate Expression<Func<TSource, bool>>

A function to test each element for a condition.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<bool>

true if any elements in the source sequence pass the test in the specified predicate; otherwise, false.

Type Parameters

TSource

The type of the elements of source.

AnyAsync<TSource>(IMongoQueryable<TSource>, CancellationToken)

Determines whether a sequence contains any elements.

public static Task<bool> AnyAsync<TSource>(this IMongoQueryable<TSource> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence to check for being empty.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<bool>

true if the source sequence contains any elements; otherwise, false.

Type Parameters

TSource

The type of the elements of source.

AppendStage<TSource, TResult>(IMongoQueryable<TSource>, PipelineStageDefinition<TSource, TResult>, IBsonSerializer<TResult>)

Appends an arbitrary stage to the LINQ pipeline.

public static IMongoQueryable<TResult> AppendStage<TSource, TResult>(this IMongoQueryable<TSource> source, PipelineStageDefinition<TSource, TResult> stage, IBsonSerializer<TResult> resultSerializer = null)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

stage PipelineStageDefinition<TSource, TResult>

The stage to append.

resultSerializer IBsonSerializer<TResult>

The result serializer.

Returns

IMongoQueryable<TResult>

The queryable with a new stage appended.

Type Parameters

TSource

The type of the elements of source.

TResult

The type of the result values returned by the appended stage.

As<TSource, TResult>(IMongoQueryable<TSource>, IBsonSerializer<TResult>)

Allows the results to be interpreted as a different type. It is up to the caller to determine that the new result type is compatible with the actual results.

public static IMongoQueryable<TResult> As<TSource, TResult>(this IMongoQueryable<TSource> source, IBsonSerializer<TResult> resultSerializer = null)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

resultSerializer IBsonSerializer<TResult>

The new serializer (optional, will be looked up if null).

Returns

IMongoQueryable<TResult>

A new IMongoQueryable with a new result type.

Type Parameters

TSource

The type of the elements of source.

TResult

The new result type for the results.

AverageAsync(IMongoQueryable<decimal>, CancellationToken)

Computes the average of a sequence of decimal values.

public static Task<decimal> AverageAsync(this IMongoQueryable<decimal> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<decimal>

A sequence of values to calculate the average of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal>

The average of the values in the sequence.

AverageAsync(IMongoQueryable<double>, CancellationToken)

Computes the average of a sequence of double values.

public static Task<double> AverageAsync(this IMongoQueryable<double> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<double>

A sequence of values to calculate the average of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The average of the values in the sequence.

AverageAsync(IMongoQueryable<int>, CancellationToken)

Computes the average of a sequence of int values.

public static Task<double> AverageAsync(this IMongoQueryable<int> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<int>

A sequence of values to calculate the average of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The average of the values in the sequence.

AverageAsync(IMongoQueryable<long>, CancellationToken)

Computes the average of a sequence of long values.

public static Task<double> AverageAsync(this IMongoQueryable<long> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<long>

A sequence of values to calculate the average of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The average of the values in the sequence.

AverageAsync(IMongoQueryable<decimal?>, CancellationToken)

Computes the average of a sequence of Nullable<T> values.

public static Task<decimal?> AverageAsync(this IMongoQueryable<decimal?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<decimal?>

A sequence of values to calculate the average of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal?>

The average of the values in the sequence.

AverageAsync(IMongoQueryable<double?>, CancellationToken)

Computes the average of a sequence of Nullable<T> values.

public static Task<double?> AverageAsync(this IMongoQueryable<double?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<double?>

A sequence of values to calculate the average of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The average of the values in the sequence.

AverageAsync(IMongoQueryable<int?>, CancellationToken)

Computes the average of a sequence of Nullable<T> values.

public static Task<double?> AverageAsync(this IMongoQueryable<int?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<int?>

A sequence of values to calculate the average of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The average of the values in the sequence.

AverageAsync(IMongoQueryable<long?>, CancellationToken)

Computes the average of a sequence of Nullable<T> values.

public static Task<double?> AverageAsync(this IMongoQueryable<long?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<long?>

A sequence of values to calculate the average of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The average of the values in the sequence.

AverageAsync(IMongoQueryable<float?>, CancellationToken)

Computes the average of a sequence of Nullable<T> values.

public static Task<float?> AverageAsync(this IMongoQueryable<float?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<float?>

A sequence of values to calculate the average of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float?>

The average of the values in the sequence.

AverageAsync(IMongoQueryable<float>, CancellationToken)

Computes the average of a sequence of float values.

public static Task<float> AverageAsync(this IMongoQueryable<float> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<float>

A sequence of values to calculate the average of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float>

The average of the values in the sequence.

AverageAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, decimal>>, CancellationToken)

Computes the average of the sequence of decimal values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<decimal> AverageAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, decimal>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal>

The average of the projected values.

Type Parameters

TSource

The type of the elements of source.

AverageAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, double>>, CancellationToken)

Computes the average of the sequence of double values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<double> AverageAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, double>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The average of the projected values.

Type Parameters

TSource

The type of the elements of source.

AverageAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, int>>, CancellationToken)

Computes the average of the sequence of int values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<double> AverageAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, int>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The average of the projected values.

Type Parameters

TSource

The type of the elements of source.

AverageAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, long>>, CancellationToken)

Computes the average of the sequence of long values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<double> AverageAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, long>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The average of the projected values.

Type Parameters

TSource

The type of the elements of source.

AverageAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, decimal?>>, CancellationToken)

Computes the average of the sequence of Nullable<T> values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<decimal?> AverageAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, decimal?>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal?>

The average of the projected values.

Type Parameters

TSource

The type of the elements of source.

AverageAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, double?>>, CancellationToken)

Computes the average of the sequence of Nullable<T> values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<double?> AverageAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, double?>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The average of the projected values.

Type Parameters

TSource

The type of the elements of source.

AverageAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, int?>>, CancellationToken)

Computes the average of the sequence of Nullable<T> values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<double?> AverageAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, int?>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The average of the projected values.

Type Parameters

TSource

The type of the elements of source.

AverageAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, long?>>, CancellationToken)

Computes the average of the sequence of Nullable<T> values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<double?> AverageAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, long?>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The average of the projected values.

Type Parameters

TSource

The type of the elements of source.

AverageAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, float?>>, CancellationToken)

Computes the average of the sequence of Nullable<T> values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<float?> AverageAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, float?>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float?>

The average of the projected values.

Type Parameters

TSource

The type of the elements of source.

AverageAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, float>>, CancellationToken)

Computes the average of the sequence of float values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<float> AverageAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, float>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float>

The average of the projected values.

Type Parameters

TSource

The type of the elements of source.

CountAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Returns the number of elements in the specified sequence that satisfies a condition.

public static Task<int> CountAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> that contains the elements to be counted.

predicate Expression<Func<TSource, bool>>

A function to test each element for a condition.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int>

The number of elements in the sequence that satisfies the condition in the predicate function.

Type Parameters

TSource

The type of the elements of source.

CountAsync<TSource>(IMongoQueryable<TSource>, CancellationToken)

Returns the number of elements in a sequence.

public static Task<int> CountAsync<TSource>(this IMongoQueryable<TSource> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

The IMongoQueryable<T> that contains the elements to be counted.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int>

The number of elements in the input sequence.

Type Parameters

TSource

The type of the elements of source.

Densify<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, object>>, DensifyRange, IEnumerable<Expression<Func<TSource, object>>>)

Adds a $densify stage to the LINQ pipeline.

public static IMongoQueryable<TSource> Densify<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, object>> field, DensifyRange range, IEnumerable<Expression<Func<TSource, object>>> partitionByFields = null)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

field Expression<Func<TSource, object>>

The field.

range DensifyRange

The range.

partitionByFields IEnumerable<Expression<Func<TSource, object>>>

The partition by fields.

Returns

IMongoQueryable<TSource>

The densified sequence of values.

Type Parameters

TSource

The type of the elements of source.

Densify<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, object>>, DensifyRange, params Expression<Func<TSource, object>>[])

Adds a $densify stage to the LINQ pipeline.

public static IMongoQueryable<TSource> Densify<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, object>> field, DensifyRange range, params Expression<Func<TSource, object>>[] partitionByFields)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

field Expression<Func<TSource, object>>

The field.

range DensifyRange

The range.

partitionByFields Expression<Func<TSource, object>>[]

The partition by fields.

Returns

IMongoQueryable<TSource>

The densified sequence of values.

Type Parameters

TSource

The type of the elements of source.

Distinct<TSource>(IMongoQueryable<TSource>)

Returns distinct elements from a sequence by using the default equality comparer to compare values.

public static IMongoQueryable<TSource> Distinct<TSource>(this IMongoQueryable<TSource> source)

Parameters

source IMongoQueryable<TSource>

The IMongoQueryable<T> to remove duplicates from.

Returns

IMongoQueryable<TSource>

An IMongoQueryable<T> that contains distinct elements from source.

Type Parameters

TSource

The type of the elements of source.

Documents<TDocument>(IMongoQueryable<NoPipelineInput>, IEnumerable<TDocument>, IBsonSerializer<TDocument>)

Injects a sequence of documents at the beginning of a pipeline.

public static IMongoQueryable<TDocument> Documents<TDocument>(this IMongoQueryable<NoPipelineInput> source, IEnumerable<TDocument> documents, IBsonSerializer<TDocument> documentSerializer)

Parameters

source IMongoQueryable<NoPipelineInput>

An IMongoQueryable with no other input.

documents IEnumerable<TDocument>

The documents.

documentSerializer IBsonSerializer<TDocument>

The document serializer.

Returns

IMongoQueryable<TDocument>

An IMongoQueryable<T> whose elements are the documents.

Type Parameters

TDocument

The type of the documents.

Documents<TDocument>(IMongoQueryable<NoPipelineInput>, params TDocument[])

Injects a sequence of documents at the beginning of a pipeline.

public static IMongoQueryable<TDocument> Documents<TDocument>(this IMongoQueryable<NoPipelineInput> source, params TDocument[] documents)

Parameters

source IMongoQueryable<NoPipelineInput>

An IMongoQueryable with no other input.

documents TDocument[]

The documents.

Returns

IMongoQueryable<TDocument>

An IMongoQueryable<T> whose elements are the documents.

Type Parameters

TDocument

The type of the documents.

FirstAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Returns the first element of a sequence that satisfies a specified condition.

public static Task<TSource> FirstAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> to return an element from.

predicate Expression<Func<TSource, bool>>

A function to test each element for a condition.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TSource>

The first element in source that passes the test in predicate.

Type Parameters

TSource

The type of the elements of source.

FirstAsync<TSource>(IMongoQueryable<TSource>, CancellationToken)

Returns the first element of a sequence.

public static Task<TSource> FirstAsync<TSource>(this IMongoQueryable<TSource> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

The IMongoQueryable<T> to return the first element of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TSource>

The first element in source.

Type Parameters

TSource

The type of the elements of source.

FirstOrDefaultAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Returns the first element of a sequence that satisfies a specified condition or a default value if no such element is found.

public static Task<TSource> FirstOrDefaultAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> to return an element from.

predicate Expression<Func<TSource, bool>>

A function to test each element for a condition.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TSource>

default(TSource) if source is empty or if no element passes the test specified by predicate; otherwise, the first element in source that passes the test specified by predicate.

Type Parameters

TSource

The type of the elements of source.

FirstOrDefaultAsync<TSource>(IMongoQueryable<TSource>, CancellationToken)

Returns the first element of a sequence, or a default value if the sequence contains no elements.

public static Task<TSource> FirstOrDefaultAsync<TSource>(this IMongoQueryable<TSource> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

The IMongoQueryable<T> to return the first element of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TSource>

default(TSource) if source is empty; otherwise, the first element in source.

Type Parameters

TSource

The type of the elements of source.

GroupBy<TSource, TKey>(IMongoQueryable<TSource>, Expression<Func<TSource, TKey>>)

Groups the elements of a sequence according to a specified key selector function.

public static IMongoQueryable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IMongoQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> whose elements to group.

keySelector Expression<Func<TSource, TKey>>

A function to extract the key for each element.

Returns

IMongoQueryable<IGrouping<TKey, TSource>>

An IMongoQueryable<T> that has a type argument of IGrouping<TKey, TElement> and where each IGrouping<TKey, TElement> object contains a sequence of objects and a key.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by the function represented in keySelector.

GroupBy<TSource, TKey, TResult>(IMongoQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TKey, IEnumerable<TSource>, TResult>>)

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.

public static IMongoQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IMongoQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TKey, IEnumerable<TSource>, TResult>> resultSelector)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> whose elements to group.

keySelector Expression<Func<TSource, TKey>>

A function to extract the key for each element.

resultSelector Expression<Func<TKey, IEnumerable<TSource>, TResult>>

A function to create a result value from each group.

Returns

IMongoQueryable<TResult>

An IMongoQueryable<T> that has a type argument of TResult and where each element represents a projection over a group and its key.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by the function represented in keySelector.

TResult

The type of the result value returned by resultSelector.

GroupJoin<TOuter, TInner, TKey, TResult>(IMongoQueryable<TOuter>, IMongoCollection<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, IEnumerable<TInner>, TResult>>)

Correlates the elements of two sequences based on key equality and groups the results.

public static IMongoQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IMongoQueryable<TOuter> outer, IMongoCollection<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IEnumerable<TInner>, TResult>> resultSelector)

Parameters

outer IMongoQueryable<TOuter>

The first sequence to join.

inner IMongoCollection<TInner>

The collection to join to the first sequence.

outerKeySelector Expression<Func<TOuter, TKey>>

A function to extract the join key from each element of the first sequence.

innerKeySelector Expression<Func<TInner, TKey>>

A function to extract the join key from each element of the second sequence.

resultSelector Expression<Func<TOuter, IEnumerable<TInner>, TResult>>

A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence.

Returns

IMongoQueryable<TResult>

An IMongoQueryable<T> that contains elements of type TResult obtained by performing a grouped join on two sequences.

Type Parameters

TOuter

The type of the elements of the first sequence.

TInner

The type of the elements of the second sequence.

TKey

The type of the keys returned by the key selector functions.

TResult

The type of the result elements.

GroupJoin<TOuter, TInner, TKey, TResult>(IMongoQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, IEnumerable<TInner>, TResult>>)

Correlates the elements of two sequences based on key equality and groups the results.

public static IMongoQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IMongoQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IEnumerable<TInner>, TResult>> resultSelector)

Parameters

outer IMongoQueryable<TOuter>

The first sequence to join.

inner IEnumerable<TInner>

The sequence to join to the first sequence.

outerKeySelector Expression<Func<TOuter, TKey>>

A function to extract the join key from each element of the first sequence.

innerKeySelector Expression<Func<TInner, TKey>>

A function to extract the join key from each element of the second sequence.

resultSelector Expression<Func<TOuter, IEnumerable<TInner>, TResult>>

A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence.

Returns

IMongoQueryable<TResult>

An IMongoQueryable<T> that contains elements of type TResult obtained by performing a grouped join on two sequences.

Type Parameters

TOuter

The type of the elements of the first sequence.

TInner

The type of the elements of the second sequence.

TKey

The type of the keys returned by the key selector functions.

TResult

The type of the result elements.

Join<TOuter, TInner, TKey, TResult>(IMongoQueryable<TOuter>, IMongoCollection<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner, TResult>>)

Correlates the elements of two sequences based on matching keys.

public static IMongoQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IMongoQueryable<TOuter> outer, IMongoCollection<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, TResult>> resultSelector)

Parameters

outer IMongoQueryable<TOuter>

The first sequence to join.

inner IMongoCollection<TInner>

The sequence to join to the first sequence.

outerKeySelector Expression<Func<TOuter, TKey>>

A function to extract the join key from each element of the first sequence.

innerKeySelector Expression<Func<TInner, TKey>>

A function to extract the join key from each element of the second sequence.

resultSelector Expression<Func<TOuter, TInner, TResult>>

A function to create a result element from two matching elements.

Returns

IMongoQueryable<TResult>

An IQueryable<T> that has elements of type TResult obtained by performing an inner join on two sequences.

Type Parameters

TOuter

The type of the elements of the first sequence.

TInner

The type of the elements of the second sequence.

TKey

The type of the keys returned by the key selector functions.

TResult

The type of the result elements.

Join<TOuter, TInner, TKey, TResult>(IMongoQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner, TResult>>)

Correlates the elements of two sequences based on matching keys.

public static IMongoQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IMongoQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, TResult>> resultSelector)

Parameters

outer IMongoQueryable<TOuter>

The first sequence to join.

inner IEnumerable<TInner>

The sequence to join to the first sequence.

outerKeySelector Expression<Func<TOuter, TKey>>

A function to extract the join key from each element of the first sequence.

innerKeySelector Expression<Func<TInner, TKey>>

A function to extract the join key from each element of the second sequence.

resultSelector Expression<Func<TOuter, TInner, TResult>>

A function to create a result element from two matching elements.

Returns

IMongoQueryable<TResult>

An IQueryable<T> that has elements of type TResult obtained by performing an inner join on two sequences.

Type Parameters

TOuter

The type of the elements of the first sequence.

TInner

The type of the elements of the second sequence.

TKey

The type of the keys returned by the key selector functions.

TResult

The type of the result elements.

LongCountAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Returns the number of elements in the specified sequence that satisfies a condition.

public static Task<long> LongCountAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> that contains the elements to be counted.

predicate Expression<Func<TSource, bool>>

A function to test each element for a condition.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long>

The number of elements in the sequence that satisfies the condition in the predicate function.

Type Parameters

TSource

The type of the elements of source.

LongCountAsync<TSource>(IMongoQueryable<TSource>, CancellationToken)

Returns the number of elements in a sequence.

public static Task<long> LongCountAsync<TSource>(this IMongoQueryable<TSource> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

The IMongoQueryable<T> that contains the elements to be counted.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long>

The number of elements in the input sequence.

Type Parameters

TSource

The type of the elements of source.

MaxAsync<TSource>(IMongoQueryable<TSource>, CancellationToken)

Returns the maximum value in a generic IMongoQueryable<T>.

public static Task<TSource> MaxAsync<TSource>(this IMongoQueryable<TSource> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to determine the maximum of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TSource>

The maximum value in the sequence.

Type Parameters

TSource

The type of the elements of source.

MaxAsync<TSource, TResult>(IMongoQueryable<TSource>, Expression<Func<TSource, TResult>>, CancellationToken)

Invokes a projection function on each element of a generic IMongoQueryable<T> and returns the maximum resulting value.

public static Task<TResult> MaxAsync<TSource, TResult>(this IMongoQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to determine the maximum of.

selector Expression<Func<TSource, TResult>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TResult>

The maximum value in the sequence.

Type Parameters

TSource

The type of the elements of source.

TResult

The type of the value returned by the function represented by selector.

MinAsync<TSource>(IMongoQueryable<TSource>, CancellationToken)

Returns the minimum value in a generic IMongoQueryable<T>.

public static Task<TSource> MinAsync<TSource>(this IMongoQueryable<TSource> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to determine the minimum of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TSource>

The minimum value in the sequence.

Type Parameters

TSource

The type of the elements of source.

MinAsync<TSource, TResult>(IMongoQueryable<TSource>, Expression<Func<TSource, TResult>>, CancellationToken)

Invokes a projection function on each element of a generic IMongoQueryable<T> and returns the minimum resulting value.

public static Task<TResult> MinAsync<TSource, TResult>(this IMongoQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to determine the minimum of.

selector Expression<Func<TSource, TResult>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TResult>

The minimum value in the sequence.

Type Parameters

TSource

The type of the elements of source.

TResult

The type of the value returned by the function represented by selector.

OfType<TResult>(IMongoQueryable)

Filters the elements of an IMongoQueryable based on a specified type.

public static IMongoQueryable<TResult> OfType<TResult>(this IMongoQueryable source)

Parameters

source IMongoQueryable

An IMongoQueryable whose elements to filter.

Returns

IMongoQueryable<TResult>

A collection that contains the elements from source that have type TResult.

Type Parameters

TResult

The type to filter the elements of the sequence on.

OrderByDescending<TSource, TKey>(IMongoQueryable<TSource>, Expression<Func<TSource, TKey>>)

Sorts the elements of a sequence in descending order according to a key.

public static IOrderedMongoQueryable<TSource> OrderByDescending<TSource, TKey>(this IMongoQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to order.

keySelector Expression<Func<TSource, TKey>>

A function to extract a key from an element.

Returns

IOrderedMongoQueryable<TSource>

An IOrderedMongoQueryable<T> whose elements are sorted in descending order according to a key.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by the function that is represented by keySelector.

OrderBy<TSource, TKey>(IMongoQueryable<TSource>, Expression<Func<TSource, TKey>>)

Sorts the elements of a sequence in ascending order according to a key.

public static IOrderedMongoQueryable<TSource> OrderBy<TSource, TKey>(this IMongoQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to order.

keySelector Expression<Func<TSource, TKey>>

A function to extract a key from an element.

Returns

IOrderedMongoQueryable<TSource>

An IOrderedMongoQueryable<T> whose elements are sorted according to a key.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by the function that is represented by keySelector.

Sample<TSource>(IMongoQueryable<TSource>, long)

Returns a sample of the elements in the source.

public static IMongoQueryable<TSource> Sample<TSource>(this IMongoQueryable<TSource> source, long count)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> to return a sample of.

count long

The number of elements in the sample.

Returns

IMongoQueryable<TSource>

A sample of the elements in the source.

Type Parameters

TSource

The type of the elements of source.

SearchMeta<TSource>(IMongoQueryable<TSource>, SearchDefinition<TSource>, string, SearchCountOptions)

Appends a $searchMeta stage to the LINQ pipeline.

public static IMongoQueryable<SearchMetaResult> SearchMeta<TSource>(this IMongoQueryable<TSource> source, SearchDefinition<TSource> searchDefinition, string indexName = null, SearchCountOptions count = null)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

searchDefinition SearchDefinition<TSource>

The search definition.

indexName string

The index name.

count SearchCountOptions

The count options.

Returns

IMongoQueryable<SearchMetaResult>

The queryable with a new stage appended.

Type Parameters

TSource

The type of the elements of source.

Search<TSource>(IMongoQueryable<TSource>, SearchDefinition<TSource>, SearchHighlightOptions<TSource>, string, SearchCountOptions, bool, bool)

Appends a $search stage to the LINQ pipeline.

public static IMongoQueryable<TSource> Search<TSource>(this IMongoQueryable<TSource> source, SearchDefinition<TSource> searchDefinition, SearchHighlightOptions<TSource> highlight = null, string indexName = null, SearchCountOptions count = null, bool returnStoredSource = false, bool scoreDetails = false)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

searchDefinition SearchDefinition<TSource>

The search definition.

highlight SearchHighlightOptions<TSource>

The highlight options.

indexName string

The index name.

count SearchCountOptions

The count options.

returnStoredSource bool

Flag that specifies whether to perform a full document lookup on the backend database or return only stored source fields directly from Atlas Search.

scoreDetails bool

Flag that specifies whether to return a detailed breakdown of the score for each document in the result.

Returns

IMongoQueryable<TSource>

The queryable with a new stage appended.

Type Parameters

TSource

The type of the elements of source.

Search<TSource>(IMongoQueryable<TSource>, SearchDefinition<TSource>, SearchOptions<TSource>)

Appends a $search stage to the LINQ pipeline.

public static IMongoQueryable<TSource> Search<TSource>(this IMongoQueryable<TSource> source, SearchDefinition<TSource> searchDefinition, SearchOptions<TSource> searchOptions)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

searchDefinition SearchDefinition<TSource>

The search definition.

searchOptions SearchOptions<TSource>

The search options.

Returns

IMongoQueryable<TSource>

The queryable with a new stage appended.

Type Parameters

TSource

The type of the elements of source.

SelectMany<TSource, TResult>(IMongoQueryable<TSource>, Expression<Func<TSource, IEnumerable<TResult>>>)

Projects each element of a sequence to an IEnumerable<T> and combines the resulting sequences into one sequence.

public static IMongoQueryable<TResult> SelectMany<TSource, TResult>(this IMongoQueryable<TSource> source, Expression<Func<TSource, IEnumerable<TResult>>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to project.

selector Expression<Func<TSource, IEnumerable<TResult>>>

A projection function to apply to each element.

Returns

IMongoQueryable<TResult>

An IMongoQueryable<T> whose elements are the result of invoking a one-to-many projection function on each element of the input sequence.

Type Parameters

TSource

The type of the elements of source.

TResult

The type of the elements of the sequence returned by the function represented by selector.

SelectMany<TSource, TCollection, TResult>(IMongoQueryable<TSource>, Expression<Func<TSource, IEnumerable<TCollection>>>, Expression<Func<TSource, TCollection, TResult>>)

Projects each element of a sequence to an IEnumerable<T> 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.

public static IMongoQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IMongoQueryable<TSource> source, Expression<Func<TSource, IEnumerable<TCollection>>> collectionSelector, Expression<Func<TSource, TCollection, TResult>> resultSelector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to project.

collectionSelector Expression<Func<TSource, IEnumerable<TCollection>>>

A projection function to apply to each element of the input sequence.

resultSelector Expression<Func<TSource, TCollection, TResult>>

A projection function to apply to each element of each intermediate sequence.

Returns

IMongoQueryable<TResult>

An IMongoQueryable<T> whose elements are the result of invoking the one-to-many projection function collectionSelector on each element of source and then mapping each of those sequence elements and their corresponding source element to a result element.

Type Parameters

TSource

The type of the elements of source.

TCollection

The type of the intermediate elements collected by the function represented by collectionSelector.

TResult

The type of the elements of the resulting sequence.

Select<TSource, TResult>(IMongoQueryable<TSource>, Expression<Func<TSource, TResult>>)

Projects each element of a sequence into a new form by incorporating the element's index.

public static IMongoQueryable<TResult> Select<TSource, TResult>(this IMongoQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to project.

selector Expression<Func<TSource, TResult>>

A projection function to apply to each element.

Returns

IMongoQueryable<TResult>

An IMongoQueryable<T> whose elements are the result of invoking a projection function on each element of source.

Type Parameters

TSource

The type of the elements of source.

TResult

The type of the value returned by the function represented by selector.

SingleAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.

public static Task<TSource> SingleAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> to return a single element from.

predicate Expression<Func<TSource, bool>>

A function to test an element for a condition.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TSource>

The single element of the input sequence that satisfies the condition in predicate.

Type Parameters

TSource

The type of the elements of source.

SingleAsync<TSource>(IMongoQueryable<TSource>, CancellationToken)

Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.

public static Task<TSource> SingleAsync<TSource>(this IMongoQueryable<TSource> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> to return the single element of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TSource>

The single element of the input sequence.

Type Parameters

TSource

The type of the elements of source.

SingleOrDefaultAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

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.

public static Task<TSource> SingleOrDefaultAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> to return a single element from.

predicate Expression<Func<TSource, bool>>

A function to test an element for a condition.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TSource>

The single element of the input sequence that satisfies the condition in predicate, or default(TSource) if no such element is found.

Type Parameters

TSource

The type of the elements of source.

SingleOrDefaultAsync<TSource>(IMongoQueryable<TSource>, CancellationToken)

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.

public static Task<TSource> SingleOrDefaultAsync<TSource>(this IMongoQueryable<TSource> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> to return the single element of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TSource>

The single element of the input sequence, or default(TSource) if the sequence contains no elements.

Type Parameters

TSource

The type of the elements of source.

Skip<TSource>(IMongoQueryable<TSource>, int)

Bypasses a specified number of elements in a sequence and then returns the remaining elements.

public static IMongoQueryable<TSource> Skip<TSource>(this IMongoQueryable<TSource> source, int count)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> to return elements from.

count int

The number of elements to skip before returning the remaining elements.

Returns

IMongoQueryable<TSource>

An IMongoQueryable<T> that contains elements that occur after the specified index in the input sequence.

Type Parameters

TSource

The type of the elements of source

Skip<TSource>(IMongoQueryable<TSource>, long)

Bypasses a specified number of elements in a sequence and then returns the remaining elements.

public static IMongoQueryable<TSource> Skip<TSource>(this IMongoQueryable<TSource> source, long count)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> to return elements from.

count long

The number of elements to skip before returning the remaining elements.

Returns

IMongoQueryable<TSource>

An IMongoQueryable<T> that contains elements that occur after the specified index in the input sequence.

Type Parameters

TSource

The type of the elements of source

StandardDeviationPopulation(IMongoQueryable<decimal>)

Computes the population standard deviation of a sequence of values.

public static decimal StandardDeviationPopulation(this IMongoQueryable<decimal> source)

Parameters

source IMongoQueryable<decimal>

A sequence of values to calculate the population standard deviation of.

Returns

decimal

The population standard deviation of the sequence of values.

StandardDeviationPopulation(IMongoQueryable<double>)

Computes the population standard deviation of a sequence of values.

public static double StandardDeviationPopulation(this IMongoQueryable<double> source)

Parameters

source IMongoQueryable<double>

A sequence of values to calculate the population standard deviation of.

Returns

double

The population standard deviation of the sequence of values.

StandardDeviationPopulation(IMongoQueryable<int>)

Computes the population standard deviation of a sequence of values.

public static double StandardDeviationPopulation(this IMongoQueryable<int> source)

Parameters

source IMongoQueryable<int>

A sequence of values to calculate the population standard deviation of.

Returns

double

The population standard deviation of the sequence of values.

StandardDeviationPopulation(IMongoQueryable<long>)

Computes the population standard deviation of a sequence of values.

public static double StandardDeviationPopulation(this IMongoQueryable<long> source)

Parameters

source IMongoQueryable<long>

A sequence of values to calculate the population standard deviation of.

Returns

double

The population standard deviation of the sequence of values.

StandardDeviationPopulation(IMongoQueryable<decimal?>)

Computes the population standard deviation of a sequence of values.

public static decimal? StandardDeviationPopulation(this IMongoQueryable<decimal?> source)

Parameters

source IMongoQueryable<decimal?>

A sequence of values to calculate the population standard deviation of.

Returns

decimal?

The population standard deviation of the sequence of values.

StandardDeviationPopulation(IMongoQueryable<double?>)

Computes the population standard deviation of a sequence of values.

public static double? StandardDeviationPopulation(this IMongoQueryable<double?> source)

Parameters

source IMongoQueryable<double?>

A sequence of values to calculate the population standard deviation of.

Returns

double?

The population standard deviation of the sequence of values.

StandardDeviationPopulation(IMongoQueryable<int?>)

Computes the population standard deviation of a sequence of values.

public static double? StandardDeviationPopulation(this IMongoQueryable<int?> source)

Parameters

source IMongoQueryable<int?>

A sequence of values to calculate the population standard deviation of.

Returns

double?

The population standard deviation of the sequence of values.

StandardDeviationPopulation(IMongoQueryable<long?>)

Computes the population standard deviation of a sequence of values.

public static double? StandardDeviationPopulation(this IMongoQueryable<long?> source)

Parameters

source IMongoQueryable<long?>

A sequence of values to calculate the population standard deviation of.

Returns

double?

The population standard deviation of the sequence of values.

StandardDeviationPopulation(IMongoQueryable<float?>)

Computes the population standard deviation of a sequence of values.

public static float? StandardDeviationPopulation(this IMongoQueryable<float?> source)

Parameters

source IMongoQueryable<float?>

A sequence of values to calculate the population standard deviation of.

Returns

float?

The population standard deviation of the sequence of values.

StandardDeviationPopulation(IMongoQueryable<float>)

Computes the population standard deviation of a sequence of values.

public static float StandardDeviationPopulation(this IMongoQueryable<float> source)

Parameters

source IMongoQueryable<float>

A sequence of values to calculate the population standard deviation of.

Returns

float

The population standard deviation of the sequence of values.

StandardDeviationPopulationAsync(IMongoQueryable<decimal>, CancellationToken)

Computes the population standard deviation of a sequence of values.

public static Task<decimal> StandardDeviationPopulationAsync(this IMongoQueryable<decimal> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<decimal>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal>

The population standard deviation of the sequence of values.

StandardDeviationPopulationAsync(IMongoQueryable<double>, CancellationToken)

Computes the population standard deviation of a sequence of values.

public static Task<double> StandardDeviationPopulationAsync(this IMongoQueryable<double> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<double>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The population standard deviation of the sequence of values.

StandardDeviationPopulationAsync(IMongoQueryable<int>, CancellationToken)

Computes the population standard deviation of a sequence of values.

public static Task<double> StandardDeviationPopulationAsync(this IMongoQueryable<int> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<int>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The population standard deviation of the sequence of values.

StandardDeviationPopulationAsync(IMongoQueryable<long>, CancellationToken)

Computes the population standard deviation of a sequence of values.

public static Task<double> StandardDeviationPopulationAsync(this IMongoQueryable<long> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<long>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The population standard deviation of the sequence of values.

StandardDeviationPopulationAsync(IMongoQueryable<decimal?>, CancellationToken)

Computes the population standard deviation of a sequence of values.

public static Task<decimal?> StandardDeviationPopulationAsync(this IMongoQueryable<decimal?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<decimal?>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal?>

The population standard deviation of the sequence of values.

StandardDeviationPopulationAsync(IMongoQueryable<double?>, CancellationToken)

Computes the population standard deviation of a sequence of values.

public static Task<double?> StandardDeviationPopulationAsync(this IMongoQueryable<double?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<double?>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The population standard deviation of the sequence of values.

StandardDeviationPopulationAsync(IMongoQueryable<int?>, CancellationToken)

Computes the population standard deviation of a sequence of values.

public static Task<double?> StandardDeviationPopulationAsync(this IMongoQueryable<int?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<int?>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The population standard deviation of the sequence of values.

StandardDeviationPopulationAsync(IMongoQueryable<long?>, CancellationToken)

Computes the population standard deviation of a sequence of values.

public static Task<double?> StandardDeviationPopulationAsync(this IMongoQueryable<long?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<long?>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The population standard deviation of the sequence of values.

StandardDeviationPopulationAsync(IMongoQueryable<float?>, CancellationToken)

Computes the population standard deviation of a sequence of values.

public static Task<float?> StandardDeviationPopulationAsync(this IMongoQueryable<float?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<float?>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float?>

The population standard deviation of the sequence of values.

StandardDeviationPopulationAsync(IMongoQueryable<float>, CancellationToken)

Computes the population standard deviation of a sequence of values.

public static Task<float> StandardDeviationPopulationAsync(this IMongoQueryable<float> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<float>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float>

The population standard deviation of the sequence of values.

StandardDeviationPopulationAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, decimal>>, CancellationToken)

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.

public static Task<decimal> StandardDeviationPopulationAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, decimal>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulationAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, double>>, CancellationToken)

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.

public static Task<double> StandardDeviationPopulationAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, double>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulationAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, int>>, CancellationToken)

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.

public static Task<double> StandardDeviationPopulationAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, int>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulationAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, long>>, CancellationToken)

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.

public static Task<double> StandardDeviationPopulationAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, long>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulationAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, decimal?>>, CancellationToken)

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.

public static Task<decimal?> StandardDeviationPopulationAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, decimal?>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal?>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulationAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, double?>>, CancellationToken)

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.

public static Task<double?> StandardDeviationPopulationAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, double?>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulationAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, int?>>, CancellationToken)

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.

public static Task<double?> StandardDeviationPopulationAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, int?>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulationAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, long?>>, CancellationToken)

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.

public static Task<double?> StandardDeviationPopulationAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, long?>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulationAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, float?>>, CancellationToken)

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.

public static Task<float?> StandardDeviationPopulationAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, float?>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float?>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulationAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, float>>, CancellationToken)

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.

public static Task<float> StandardDeviationPopulationAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, float>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulation<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, decimal>>)

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.

public static decimal StandardDeviationPopulation<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, decimal>>

A transform function to apply to each element.

Returns

decimal

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulation<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, double>>)

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.

public static double StandardDeviationPopulation<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, double>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, double>>

A transform function to apply to each element.

Returns

double

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulation<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, int>>)

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.

public static double StandardDeviationPopulation<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, int>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, int>>

A transform function to apply to each element.

Returns

double

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulation<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, long>>)

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.

public static double StandardDeviationPopulation<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, long>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, long>>

A transform function to apply to each element.

Returns

double

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulation<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, decimal?>>)

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.

public static decimal? StandardDeviationPopulation<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, decimal?>>

A transform function to apply to each element.

Returns

decimal?

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulation<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, double?>>)

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.

public static double? StandardDeviationPopulation<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, double?>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, double?>>

A transform function to apply to each element.

Returns

double?

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulation<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, int?>>)

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.

public static double? StandardDeviationPopulation<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, int?>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, int?>>

A transform function to apply to each element.

Returns

double?

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulation<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, long?>>)

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.

public static double? StandardDeviationPopulation<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, long?>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, long?>>

A transform function to apply to each element.

Returns

double?

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulation<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, float?>>)

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.

public static float? StandardDeviationPopulation<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, float?>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, float?>>

A transform function to apply to each element.

Returns

float?

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationPopulation<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, float>>)

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.

public static float StandardDeviationPopulation<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, float>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, float>>

A transform function to apply to each element.

Returns

float

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSample(IMongoQueryable<decimal>)

Computes the sample standard deviation of a sequence of values.

public static decimal StandardDeviationSample(this IMongoQueryable<decimal> source)

Parameters

source IMongoQueryable<decimal>

A sequence of values to calculate the population standard deviation of.

Returns

decimal

The population standard deviation of the sequence of values.

StandardDeviationSample(IMongoQueryable<double>)

Computes the sample standard deviation of a sequence of values.

public static double StandardDeviationSample(this IMongoQueryable<double> source)

Parameters

source IMongoQueryable<double>

A sequence of values to calculate the population standard deviation of.

Returns

double

The population standard deviation of the sequence of values.

StandardDeviationSample(IMongoQueryable<int>)

Computes the sample standard deviation of a sequence of values.

public static double StandardDeviationSample(this IMongoQueryable<int> source)

Parameters

source IMongoQueryable<int>

A sequence of values to calculate the population standard deviation of.

Returns

double

The population standard deviation of the sequence of values.

StandardDeviationSample(IMongoQueryable<long>)

Computes the sample standard deviation of a sequence of values.

public static double StandardDeviationSample(this IMongoQueryable<long> source)

Parameters

source IMongoQueryable<long>

A sequence of values to calculate the population standard deviation of.

Returns

double

The population standard deviation of the sequence of values.

StandardDeviationSample(IMongoQueryable<decimal?>)

Computes the sample standard deviation of a sequence of values.

public static decimal? StandardDeviationSample(this IMongoQueryable<decimal?> source)

Parameters

source IMongoQueryable<decimal?>

A sequence of values to calculate the population standard deviation of.

Returns

decimal?

The population standard deviation of the sequence of values.

StandardDeviationSample(IMongoQueryable<double?>)

Computes the sample standard deviation of a sequence of values.

public static double? StandardDeviationSample(this IMongoQueryable<double?> source)

Parameters

source IMongoQueryable<double?>

A sequence of values to calculate the population standard deviation of.

Returns

double?

The population standard deviation of the sequence of values.

StandardDeviationSample(IMongoQueryable<int?>)

Computes the sample standard deviation of a sequence of values.

public static double? StandardDeviationSample(this IMongoQueryable<int?> source)

Parameters

source IMongoQueryable<int?>

A sequence of values to calculate the population standard deviation of.

Returns

double?

The population standard deviation of the sequence of values.

StandardDeviationSample(IMongoQueryable<long?>)

Computes the sample standard deviation of a sequence of values.

public static double? StandardDeviationSample(this IMongoQueryable<long?> source)

Parameters

source IMongoQueryable<long?>

A sequence of values to calculate the population standard deviation of.

Returns

double?

The population standard deviation of the sequence of values.

StandardDeviationSample(IMongoQueryable<float?>)

Computes the sample standard deviation of a sequence of values.

public static float? StandardDeviationSample(this IMongoQueryable<float?> source)

Parameters

source IMongoQueryable<float?>

A sequence of values to calculate the population standard deviation of.

Returns

float?

The population standard deviation of the sequence of values.

StandardDeviationSample(IMongoQueryable<float>)

Computes the sample standard deviation of a sequence of values.

public static float StandardDeviationSample(this IMongoQueryable<float> source)

Parameters

source IMongoQueryable<float>

A sequence of values to calculate the population standard deviation of.

Returns

float

The population standard deviation of the sequence of values.

StandardDeviationSampleAsync(IMongoQueryable<decimal>, CancellationToken)

Computes the sample standard deviation of a sequence of values.

public static Task<decimal> StandardDeviationSampleAsync(this IMongoQueryable<decimal> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<decimal>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal>

The population standard deviation of the sequence of values.

StandardDeviationSampleAsync(IMongoQueryable<double>, CancellationToken)

Computes the sample standard deviation of a sequence of values.

public static Task<double> StandardDeviationSampleAsync(this IMongoQueryable<double> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<double>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The population standard deviation of the sequence of values.

StandardDeviationSampleAsync(IMongoQueryable<int>, CancellationToken)

Computes the sample standard deviation of a sequence of values.

public static Task<double> StandardDeviationSampleAsync(this IMongoQueryable<int> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<int>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The population standard deviation of the sequence of values.

StandardDeviationSampleAsync(IMongoQueryable<long>, CancellationToken)

Computes the sample standard deviation of a sequence of values.

public static Task<double> StandardDeviationSampleAsync(this IMongoQueryable<long> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<long>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The population standard deviation of the sequence of values.

StandardDeviationSampleAsync(IMongoQueryable<decimal?>, CancellationToken)

Computes the sample standard deviation of a sequence of values.

public static Task<decimal?> StandardDeviationSampleAsync(this IMongoQueryable<decimal?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<decimal?>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal?>

The population standard deviation of the sequence of values.

StandardDeviationSampleAsync(IMongoQueryable<double?>, CancellationToken)

Computes the sample standard deviation of a sequence of values.

public static Task<double?> StandardDeviationSampleAsync(this IMongoQueryable<double?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<double?>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The population standard deviation of the sequence of values.

StandardDeviationSampleAsync(IMongoQueryable<int?>, CancellationToken)

Computes the sample standard deviation of a sequence of values.

public static Task<double?> StandardDeviationSampleAsync(this IMongoQueryable<int?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<int?>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The population standard deviation of the sequence of values.

StandardDeviationSampleAsync(IMongoQueryable<long?>, CancellationToken)

Computes the sample standard deviation of a sequence of values.

public static Task<double?> StandardDeviationSampleAsync(this IMongoQueryable<long?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<long?>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The population standard deviation of the sequence of values.

StandardDeviationSampleAsync(IMongoQueryable<float?>, CancellationToken)

Computes the sample standard deviation of a sequence of values.

public static Task<float?> StandardDeviationSampleAsync(this IMongoQueryable<float?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<float?>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float?>

The population standard deviation of the sequence of values.

StandardDeviationSampleAsync(IMongoQueryable<float>, CancellationToken)

Computes the sample standard deviation of a sequence of values.

public static Task<float> StandardDeviationSampleAsync(this IMongoQueryable<float> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<float>

A sequence of values to calculate the population standard deviation of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float>

The population standard deviation of the sequence of values.

StandardDeviationSampleAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, decimal>>, CancellationToken)

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.

public static Task<decimal> StandardDeviationSampleAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, decimal>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSampleAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, double>>, CancellationToken)

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.

public static Task<double> StandardDeviationSampleAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, double>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSampleAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, int>>, CancellationToken)

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.

public static Task<double> StandardDeviationSampleAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, int>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSampleAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, long>>, CancellationToken)

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.

public static Task<double> StandardDeviationSampleAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, long>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSampleAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, decimal?>>, CancellationToken)

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.

public static Task<decimal?> StandardDeviationSampleAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, decimal?>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal?>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSampleAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, double?>>, CancellationToken)

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.

public static Task<double?> StandardDeviationSampleAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, double?>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSampleAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, int?>>, CancellationToken)

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.

public static Task<double?> StandardDeviationSampleAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, int?>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSampleAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, long?>>, CancellationToken)

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.

public static Task<double?> StandardDeviationSampleAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, long?>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSampleAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, float?>>, CancellationToken)

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.

public static Task<float?> StandardDeviationSampleAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, float?>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float?>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSampleAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, float>>, CancellationToken)

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.

public static Task<float> StandardDeviationSampleAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, float>>

A transform function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float>

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSample<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, decimal>>)

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.

public static decimal StandardDeviationSample<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, decimal>>

A transform function to apply to each element.

Returns

decimal

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSample<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, double>>)

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.

public static double StandardDeviationSample<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, double>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, double>>

A transform function to apply to each element.

Returns

double

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSample<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, int>>)

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.

public static double StandardDeviationSample<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, int>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, int>>

A transform function to apply to each element.

Returns

double

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSample<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, long>>)

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.

public static double StandardDeviationSample<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, long>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, long>>

A transform function to apply to each element.

Returns

double

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSample<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, decimal?>>)

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.

public static decimal? StandardDeviationSample<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, decimal?>>

A transform function to apply to each element.

Returns

decimal?

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSample<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, double?>>)

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.

public static double? StandardDeviationSample<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, double?>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, double?>>

A transform function to apply to each element.

Returns

double?

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSample<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, int?>>)

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.

public static double? StandardDeviationSample<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, int?>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, int?>>

A transform function to apply to each element.

Returns

double?

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSample<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, long?>>)

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.

public static double? StandardDeviationSample<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, long?>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, long?>>

A transform function to apply to each element.

Returns

double?

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSample<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, float?>>)

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.

public static float? StandardDeviationSample<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, float?>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, float?>>

A transform function to apply to each element.

Returns

float?

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

StandardDeviationSample<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, float>>)

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.

public static float StandardDeviationSample<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, float>> selector)

Parameters

source IMongoQueryable<TSource>

A sequence of values to calculate the population standard deviation of.

selector Expression<Func<TSource, float>>

A transform function to apply to each element.

Returns

float

The population standard deviation of the sequence of values.

Type Parameters

TSource

The type of the elements of source.

SumAsync(IMongoQueryable<decimal>, CancellationToken)

Computes the sum of a sequence of decimal values.

public static Task<decimal> SumAsync(this IMongoQueryable<decimal> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<decimal>

A sequence of values to calculate the sum of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal>

The sum of the values in the sequence.

SumAsync(IMongoQueryable<double>, CancellationToken)

Computes the sum of a sequence of double values.

public static Task<double> SumAsync(this IMongoQueryable<double> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<double>

A sequence of values to calculate the sum of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The sum of the values in the sequence.

SumAsync(IMongoQueryable<int>, CancellationToken)

Computes the sum of a sequence of int values.

public static Task<int> SumAsync(this IMongoQueryable<int> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<int>

A sequence of values to calculate the sum of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int>

The sum of the values in the sequence.

SumAsync(IMongoQueryable<long>, CancellationToken)

Computes the sum of a sequence of long values.

public static Task<long> SumAsync(this IMongoQueryable<long> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<long>

A sequence of values to calculate the sum of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long>

The sum of the values in the sequence.

SumAsync(IMongoQueryable<decimal?>, CancellationToken)

Computes the sum of a sequence of Nullable<T> values.

public static Task<decimal?> SumAsync(this IMongoQueryable<decimal?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<decimal?>

A sequence of values to calculate the sum of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal?>

The sum of the values in the sequence.

SumAsync(IMongoQueryable<double?>, CancellationToken)

Computes the sum of a sequence of Nullable<T> values.

public static Task<double?> SumAsync(this IMongoQueryable<double?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<double?>

A sequence of values to calculate the sum of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The sum of the values in the sequence.

SumAsync(IMongoQueryable<int?>, CancellationToken)

Computes the sum of a sequence of Nullable<T> values.

public static Task<int?> SumAsync(this IMongoQueryable<int?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<int?>

A sequence of values to calculate the sum of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int?>

The sum of the values in the sequence.

SumAsync(IMongoQueryable<long?>, CancellationToken)

Computes the sum of a sequence of Nullable<T> values.

public static Task<long?> SumAsync(this IMongoQueryable<long?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<long?>

A sequence of values to calculate the sum of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long?>

The sum of the values in the sequence.

SumAsync(IMongoQueryable<float?>, CancellationToken)

Computes the sum of a sequence of Nullable<T> values.

public static Task<float?> SumAsync(this IMongoQueryable<float?> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<float?>

A sequence of values to calculate the sum of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float?>

The sum of the values in the sequence.

SumAsync(IMongoQueryable<float>, CancellationToken)

Computes the sum of a sequence of float values.

public static Task<float> SumAsync(this IMongoQueryable<float> source, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<float>

A sequence of values to calculate the sum of.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float>

The sum of the values in the sequence.

SumAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, decimal>>, CancellationToken)

Computes the sum of the sequence of decimal values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<decimal> SumAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, decimal>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal>

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

SumAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, double>>, CancellationToken)

Computes the sum of the sequence of double values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<double> SumAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, double>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double>

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

SumAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, int>>, CancellationToken)

Computes the sum of the sequence of int values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<int> SumAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, int>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int>

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

SumAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, long>>, CancellationToken)

Computes the sum of the sequence of long values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<long> SumAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, long>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long>

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

SumAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, decimal?>>, CancellationToken)

Computes the sum of the sequence of Nullable<T> values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<decimal?> SumAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, decimal?>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<decimal?>

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

SumAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, double?>>, CancellationToken)

Computes the sum of the sequence of Nullable<T> values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<double?> SumAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, double?>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<double?>

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

SumAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, int?>>, CancellationToken)

Computes the sum of the sequence of Nullable<T> values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<int?> SumAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, int?>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<int?>

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

SumAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, long?>>, CancellationToken)

Computes the sum of the sequence of Nullable<T> values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<long?> SumAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, long?>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<long?>

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

SumAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, float?>>, CancellationToken)

Computes the sum of the sequence of Nullable<T> values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<float?> SumAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, float?>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float?>

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

SumAsync<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, float>>, CancellationToken)

Computes the sum of the sequence of float values that is obtained by invoking a projection function on each element of the input sequence.

public static Task<float> SumAsync<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken = default)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

selector Expression<Func<TSource, float>>

A projection function to apply to each element.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<float>

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

Take<TSource>(IMongoQueryable<TSource>, int)

Returns a specified number of contiguous elements from the start of a sequence.

public static IMongoQueryable<TSource> Take<TSource>(this IMongoQueryable<TSource> source, int count)

Parameters

source IMongoQueryable<TSource>

The sequence to return elements from.

count int

The number of elements to return.

Returns

IMongoQueryable<TSource>

An IMongoQueryable<T> that contains the specified number of elements from the start of source.

Type Parameters

TSource

The type of the elements of source.

Take<TSource>(IMongoQueryable<TSource>, long)

Returns a specified number of contiguous elements from the start of a sequence.

public static IMongoQueryable<TSource> Take<TSource>(this IMongoQueryable<TSource> source, long count)

Parameters

source IMongoQueryable<TSource>

The sequence to return elements from.

count long

The number of elements to return.

Returns

IMongoQueryable<TSource>

An IMongoQueryable<T> that contains the specified number of elements from the start of source.

Type Parameters

TSource

The type of the elements of source.

ThenByDescending<TSource, TKey>(IOrderedMongoQueryable<TSource>, Expression<Func<TSource, TKey>>)

Performs a subsequent ordering of the elements in a sequence in descending order according to a key.

public static IOrderedMongoQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedMongoQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)

Parameters

source IOrderedMongoQueryable<TSource>

A sequence of values to order.

keySelector Expression<Func<TSource, TKey>>

A function to extract a key from an element.

Returns

IOrderedMongoQueryable<TSource>

An IOrderedMongoQueryable<T> whose elements are sorted in descending order according to a key.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by the function that is represented by keySelector.

ThenBy<TSource, TKey>(IOrderedMongoQueryable<TSource>, Expression<Func<TSource, TKey>>)

Performs a subsequent ordering of the elements in a sequence in ascending order according to a key.

public static IOrderedMongoQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedMongoQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)

Parameters

source IOrderedMongoQueryable<TSource>

A sequence of values to order.

keySelector Expression<Func<TSource, TKey>>

A function to extract a key from an element.

Returns

IOrderedMongoQueryable<TSource>

An IOrderedMongoQueryable<T> whose elements are sorted according to a key.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by the function that is represented by keySelector.

VectorSearch<TSource, TField>(IMongoQueryable<TSource>, FieldDefinition<TSource>, QueryVector, int, VectorSearchOptions<TSource>)

Appends a $vectorSearch stage to the LINQ pipeline.

public static IMongoQueryable<TSource> VectorSearch<TSource, TField>(this IMongoQueryable<TSource> source, FieldDefinition<TSource> field, QueryVector queryVector, int limit, VectorSearchOptions<TSource> options = null)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

field FieldDefinition<TSource>

The field.

queryVector QueryVector

The query vector.

limit int

The limit.

options VectorSearchOptions<TSource>

The options.

Returns

IMongoQueryable<TSource>

The queryable with a new stage appended.

Type Parameters

TSource

The type of the elements of source.

TField

The type of the field.

VectorSearch<TSource, TField>(IMongoQueryable<TSource>, Expression<Func<TSource, TField>>, QueryVector, int, VectorSearchOptions<TSource>)

Appends a $vectorSearch stage to the LINQ pipeline.

public static IMongoQueryable<TSource> VectorSearch<TSource, TField>(this IMongoQueryable<TSource> source, Expression<Func<TSource, TField>> field, QueryVector queryVector, int limit, VectorSearchOptions<TSource> options = null)

Parameters

source IMongoQueryable<TSource>

A sequence of values.

field Expression<Func<TSource, TField>>

The field.

queryVector QueryVector

The query vector.

limit int

The limit.

options VectorSearchOptions<TSource>

The options.

Returns

IMongoQueryable<TSource>

The queryable with a new stage appended.

Type Parameters

TSource

The type of the elements of source.

TField

The type of the field.

Where<TSource>(IMongoQueryable<TSource>, Expression<Func<TSource, bool>>)

Filters a sequence of values based on a predicate.

public static IMongoQueryable<TSource> Where<TSource>(this IMongoQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)

Parameters

source IMongoQueryable<TSource>

An IMongoQueryable<T> to return elements from.

predicate Expression<Func<TSource, bool>>

A function to test each element for a condition.

Returns

IMongoQueryable<TSource>

An IMongoQueryable<T> that contains elements from the input sequence that satisfy the condition specified by predicate.

Type Parameters

TSource

The type of the elements of source.