Method SortBy
| MongoDB CSharp Driver API Reference (original) (raw)
Namespace
Assembly
MongoDB.Driver.dll
SortBy(IAggregateFluent, Expression<Func<TResult, object>>)
Appends an ascending sort stage to the pipeline.
public static IOrderedAggregateFluent<TResult> SortBy<TResult>(this IAggregateFluent<TResult> aggregate, Expression<Func<TResult, object>> field)Parameters
aggregate IAggregateFluent
The aggregate.
field Expression<Func<TResult, object>>
The field to sort by.
Returns
The fluent aggregate interface.
Type Parameters
TResult
The type of the result.