Sorting

Sorting.

To sort data, specify sort as a request parameter. Also, specify the column by which you want to sort.

Examples

For example, sort by the studentName column, in ascending order:

curl -X POST \
  -H "X-Appery-Database-Id: 544a5cdfe4b03d005b6233b9" \
  -H "Content-Type: application/json" \
  -d '{"sort": "studentName"}' \
  https://api.appery.io/1/db/collections/students/query
To sort in descending order, specify the column name with - before it:

curl -X POST \
  -H "X-Appery-Database-Id: 544a5cdfe4b03d005b6233b9" \
  -H "Content-Type: application/json" \
  -d '{"sort":"-studentName"}' \
  https://api.appery.io/1/db/collections/students/query
You can also sort by more than one column:
curl -X POST \
  -H "X-Appery-Database-Id: 544a5cdfe4b03d005b6233b9" \
  -H "Content-Type: application/json" \
  -d '{"sort":"studentName,studentId"}' \
  https://api.appery.io/1/db/collections/students/query