Skip to main content

sort

Description

Sorts data based on given parameters.

Syntax

sort [<global-sort-option>] [<field-sort-option>]<field> [ , [<field-sort-option>]<field>]

Required Arguments

ParameterSyntaxDescription
field<field> [, <field>]The name of the field(s) to sort by.

Optional Arguments

ParameterSyntaxDefaultDescription
global-sort-option(+|-)+Sort type: + for ascending, - for descending.
field-sort-option(+|-)global-sort-optionSort 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