When specified, requests that return multiple items can be sorted and filtered based on a few parameters and the data available.
Sorting is determined through the use of the
_sort query string parameter. The value of this is a comma-separated list of sort keys. Sort directions can optionally be appended to each sort key, separated by the
The supported sort directions are either
asc for ascending or
desc for descending. If a sort direction is not specified for a key, then a default of ascending will be assumed.
- Only sort keys specified:
key1is the first key,
key2is the second key, etc.
- Sort directions are defaulted to
- Some sort directions specified:
key1is sorted in descending order
key3still use the default order of ascending
- Equal number of sort keys and directions specified:
- Each key is paired with a corresponding direction
Filtering is determined through the use of the
_filter query string parameter. The value should (naturally) be the value you need to filter for.
Multiple filters result in an implicit
OR filters will not be supported, requiring separate requests per query.
For queries that need comparisons other than simple equals, operators are supported for inequality, greater-than, greater-than-or-equal, less-than, and less-than-or-equal-to. In order, the operators are
lte. Simple equality is the default operation, and is performed as
For example, finding objects with a size greater than
8 would be written as