You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

Advanced Queries: Sorting

When querying REST resources, results can be sorted and ordered with the request parameters sort and order.

The sort keyword is used to specify which attribute is considered for sorting the result.
Optionally the order keyword can also be used to specify the result order. Available values are asc for ascending and desc for descending ordering. (the default order is asc)

Example request:

$ curl -si -HX-User:admin -HX-Password:admin http://localhost:8082/structr/rest/files?sort=createdDate&order=desc

Search results for "Advanced Queries: Sorting"

We could not find anything matching "Advanced Queries: Sorting" in our documentation. Please rephrase your search.

You can also ask your questions in the Structr Google Group or create a free account in the Structr Support Portal.
Click here to send feedback to the Structr team.