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. |
Query Examples
Example 1
This example sorts in descending order by the user
field.
...
| sort - user
Example 2
This example sorts in ascending order by the user
field.
...
| sort user
Example 3
This example sorts sequentially: first in descending order by the user
field, then in ascending order by the id
field, and finally in descending order by the internalId
field.
...
| sort - user, +id, internalId