applyOrder
Description
applyOrder is a method that applies order to a query.
Signature
applyOrder(
orderBy: OrderParam<Entity>,
orderOptions?: ApplyOrderOptions
): SelectQueryBuilder<Entity>
Arguments
- orderBy: OrderParam<Entity>: The order to apply to the query.
- orderOptions?: ApplyOrderOptions: Additional options to apply to the order filter.
A field that is a @CalculatedColumn of the alias (tableAlias, alias, or the main one) is ordered by its value, as orderByTyped does; select it with addSelectCalculated first, or it throws a TypeError.
Usage
query.applyOrder({ field: 'name', direction: 'asc', nulls: 'last' }, { useQuotes: true })