Table of Contents

Method Top

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

Top<TInput, TResult>(ISetWindowFieldsPartition<TInput>, SortDefinition<TInput>, Func<TInput, TResult>, SetWindowFieldsWindow)

Returns the top result.

public static TResult Top<TInput, TResult>(this ISetWindowFieldsPartition<TInput> partition, SortDefinition<TInput> sortBy, Func<TInput, TResult> selector, SetWindowFieldsWindow window = null)

Parameters

partition ISetWindowFieldsPartition<TInput>

The partition.

sortBy SortDefinition<TInput>

The sort order.

selector Func<TInput, TResult>

The selector that selects a value from the input document.

window SetWindowFieldsWindow

The window boundaries.

Returns

TResult

The top result.

Type Parameters

TInput

The type of the input documents in the partition.

TResult

The result type.