Skip to main content

Sort

Sort​

Sort(key: str, order: Order)

Specification of the sort order

This class encapsulates sorting instructions for query results. It supports sorting by a single key or multiple keys. Additional sort keys can be added using the append method.

append​

append(key: str, order: Order) -> Sort

Append an additional sorting key and order.

Parameters:

NameTypeDescriptionDefault
keystr

The property key to sort by.

required
orderOrder

The sort order (Order.ASCENDING or Order.DESCENDING).

required

Returns:

TypeDescription
Sort

The current Sort instance to allow method chaining.