Table of Contents

Method LastN

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

LastN<TInput, TResult>(ISetWindowFieldsPartition<TInput>, Func<TInput, TResult>, int, SetWindowFieldsWindow)

Returns the last n results.

public static IEnumerable<TResult> LastN<TInput, TResult>(this ISetWindowFieldsPartition<TInput> partition, Func<TInput, TResult> selector, int n, SetWindowFieldsWindow window = null)

Parameters

partition ISetWindowFieldsPartition<TInput>

The partition.

selector Func<TInput, TResult>

The selector that selects a value from the input document.

n int

The number of results to return.

window SetWindowFieldsWindow

The window boundaries.

Returns

IEnumerable<TResult>

The last n results.

Type Parameters

TInput

The type of the input documents in the partition.

TResult

The result type.