sort
Description
Sorts data based on given parameters.
Syntax
sort [<global-sort-option>] [<field-sort-option>]<field> [ , [<field-sort-option>]<field>]
Required Arguments
| Parameter | Syntax | Description |
|---|---|---|
field | <field> [, <field>] | The name of the field(s) to sort by. |
Optional Arguments
| Parameter | Syntax | Default | Description |
|---|---|---|---|
global-sort-option | (+|-) | + | Sort type: + for ascending, - for descending. |
field-sort-option | (+|-) | global-sort-option | Sort type for specific fields: + for ascending, - for descending. |
maxnum | <integer> | sme.core.sort_limit | Maximum number of records processed during sorting. |
Examples
Example 1
In this example, sorting is performed in descending order by the user field.
...
| sort - user
Example 2
In this example, sort works by default and sorts the user field in ascending order.
...
| sort user
Example 3
In this example, the general order - applies to the entire query, while for the id field it is overridden by the local +. The internalId field is sorted according to the general rule.
...
| sort - user, +id, internalId