How do I sortBy in opposite direction? By default dataobjects are sorted in ascending order (1 => 10). I need it to be sorted in descending order (10 => 1)
I’m using REST API
How do I sortBy in opposite direction? By default dataobjects are sorted in ascending order (1 => 10). I need it to be sorted in descending order (10 => 1)
I’m using REST API
Hi Anton!
You can use following request:
curl -X GET -H 'application-id : xxx' -H 'secret-key : xxx' [url=https://api.backendless.com/v1/data/tableName?sortBy=ownerId%20desc]https://api.backendless.com/v1/data/tableName?sortBy=ownerId%20desc[/url]
This request you can test and export using rest console.
Regards,
Kate.
Thank you, Kate,
This is useful information, this page is missing it: https://backendless.com/documentation/data/rest/data_search_and_query.htm
what about Android API ?
Almost identical. Add " desc" to the name of the property to sort by:
For example:
QueryOptions queryOptions = new QueryOptions();
queryOptions.addSortByOption( “name desc” );
BackendlessDataQuery dataQuery = new BackendlessDataQuery();
dataQuery.setQueryOptions( queryOptions );
Cheers,
Mark