Table of Contents

Method Sum

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

Sum<TInput>(ISetWindowFieldsPartition<TInput>, Func<TInput, decimal>, SetWindowFieldsWindow)

Returns the sum of numeric values. $sum ignores non-numeric values.

public static decimal Sum<TInput>(this ISetWindowFieldsPartition<TInput> partition, Func<TInput, decimal> selector, SetWindowFieldsWindow window = null)

Parameters

partition ISetWindowFieldsPartition<TInput>

The partition.

selector Func<TInput, decimal>

The selector that selects a value from the input document.

window SetWindowFieldsWindow

The window boundaries.

Returns

decimal

The sum of the values.

Type Parameters

TInput

The type of the input documents in the partition.

Sum<TInput>(ISetWindowFieldsPartition<TInput>, Func<TInput, decimal?>, SetWindowFieldsWindow)

Returns the sum of numeric values. $sum ignores non-numeric values.

public static decimal? Sum<TInput>(this ISetWindowFieldsPartition<TInput> partition, Func<TInput, decimal?> selector, SetWindowFieldsWindow window = null)

Parameters

partition ISetWindowFieldsPartition<TInput>

The partition.

selector Func<TInput, decimal?>

The selector that selects a value from the input document.

window SetWindowFieldsWindow

The window boundaries.

Returns

decimal?

The sum of the values.

Type Parameters

TInput

The type of the input documents in the partition.

Sum<TInput>(ISetWindowFieldsPartition<TInput>, Func<TInput, double>, SetWindowFieldsWindow)

Returns the sum of numeric values. $sum ignores non-numeric values.

public static double Sum<TInput>(this ISetWindowFieldsPartition<TInput> partition, Func<TInput, double> selector, SetWindowFieldsWindow window = null)

Parameters

partition ISetWindowFieldsPartition<TInput>

The partition.

selector Func<TInput, double>

The selector that selects a value from the input document.

window SetWindowFieldsWindow

The window boundaries.

Returns

double

The sum of the values.

Type Parameters

TInput

The type of the input documents in the partition.

Sum<TInput>(ISetWindowFieldsPartition<TInput>, Func<TInput, double?>, SetWindowFieldsWindow)

Returns the sum of numeric values. $sum ignores non-numeric values.

public static double? Sum<TInput>(this ISetWindowFieldsPartition<TInput> partition, Func<TInput, double?> selector, SetWindowFieldsWindow window = null)

Parameters

partition ISetWindowFieldsPartition<TInput>

The partition.

selector Func<TInput, double?>

The selector that selects a value from the input document.

window SetWindowFieldsWindow

The window boundaries.

Returns

double?

The sum of the values.

Type Parameters

TInput

The type of the input documents in the partition.

Sum<TInput>(ISetWindowFieldsPartition<TInput>, Func<TInput, float>, SetWindowFieldsWindow)

Returns the sum of numeric values. $sum ignores non-numeric values.

public static float Sum<TInput>(this ISetWindowFieldsPartition<TInput> partition, Func<TInput, float> selector, SetWindowFieldsWindow window = null)

Parameters

partition ISetWindowFieldsPartition<TInput>

The partition.

selector Func<TInput, float>

The selector that selects a value from the input document.

window SetWindowFieldsWindow

The window boundaries.

Returns

float

The sum of the values.

Type Parameters

TInput

The type of the input documents in the partition.

Sum<TInput>(ISetWindowFieldsPartition<TInput>, Func<TInput, float?>, SetWindowFieldsWindow)

Returns the sum of numeric values. $sum ignores non-numeric values.

public static float? Sum<TInput>(this ISetWindowFieldsPartition<TInput> partition, Func<TInput, float?> selector, SetWindowFieldsWindow window = null)

Parameters

partition ISetWindowFieldsPartition<TInput>

The partition.

selector Func<TInput, float?>

The selector that selects a value from the input document.

window SetWindowFieldsWindow

The window boundaries.

Returns

float?

The sum of the values.

Type Parameters

TInput

The type of the input documents in the partition.

Sum<TInput>(ISetWindowFieldsPartition<TInput>, Func<TInput, int>, SetWindowFieldsWindow)

Returns the sum of numeric values. $sum ignores non-numeric values.

public static long Sum<TInput>(this ISetWindowFieldsPartition<TInput> partition, Func<TInput, int> selector, SetWindowFieldsWindow window = null)

Parameters

partition ISetWindowFieldsPartition<TInput>

The partition.

selector Func<TInput, int>

The selector that selects a value from the input document.

window SetWindowFieldsWindow

The window boundaries.

Returns

long

The sum of the values.

Type Parameters

TInput

The type of the input documents in the partition.

Sum<TInput>(ISetWindowFieldsPartition<TInput>, Func<TInput, int?>, SetWindowFieldsWindow)

Returns the sum of numeric values. $sum ignores non-numeric values.

public static long? Sum<TInput>(this ISetWindowFieldsPartition<TInput> partition, Func<TInput, int?> selector, SetWindowFieldsWindow window = null)

Parameters

partition ISetWindowFieldsPartition<TInput>

The partition.

selector Func<TInput, int?>

The selector that selects a value from the input document.

window SetWindowFieldsWindow

The window boundaries.

Returns

long?

The sum of the values.

Type Parameters

TInput

The type of the input documents in the partition.

Sum<TInput>(ISetWindowFieldsPartition<TInput>, Func<TInput, long>, SetWindowFieldsWindow)

Returns the sum of numeric values. $sum ignores non-numeric values.

public static long Sum<TInput>(this ISetWindowFieldsPartition<TInput> partition, Func<TInput, long> selector, SetWindowFieldsWindow window = null)

Parameters

partition ISetWindowFieldsPartition<TInput>

The partition.

selector Func<TInput, long>

The selector that selects a value from the input document.

window SetWindowFieldsWindow

The window boundaries.

Returns

long

The sum of the values.

Type Parameters

TInput

The type of the input documents in the partition.

Sum<TInput>(ISetWindowFieldsPartition<TInput>, Func<TInput, long?>, SetWindowFieldsWindow)

Returns the sum of numeric values. $sum ignores non-numeric values.

public static long? Sum<TInput>(this ISetWindowFieldsPartition<TInput> partition, Func<TInput, long?> selector, SetWindowFieldsWindow window = null)

Parameters

partition ISetWindowFieldsPartition<TInput>

The partition.

selector Func<TInput, long?>

The selector that selects a value from the input document.

window SetWindowFieldsWindow

The window boundaries.

Returns

long?

The sum of the values.

Type Parameters

TInput

The type of the input documents in the partition.