Page 2 of 2
How to get count in query response
Posted: Sun Jan 05, 2014 5:15 pm
by maxkatz
This is the correct response for the service to get a count:
Is that what you have? I think looking at your mapping, the 'count' is on the same level as $.
How to get count in query response
Posted: Wed Sep 10, 2014 8:20 pm
by Shawn
hi
I'm facing a similar challenge to get count back from a query.
I'm trying to implement pagination and need count of my query results.
The pagination example
http://devcenter.appery.io/tutorials/...
states 'For example: run a service to count how many objects there are.'
How do I implement this ?
Rgds
Shawn
How to get count in query response
Posted: Wed Sep 10, 2014 8:26 pm
by Shawn
Further to this if I add a count parameter to the Request I only get the count variable and not the Query set itself.
I would like to get the count of my query to use in pagination and the results as well to render on my page.
How to get count in query response
Posted: Wed Sep 10, 2014 8:51 pm
by Kateryna Grynko
Hi Shawn,
There should be the following service response if you use a request parameter count=1.
How to get count in query response
Posted: Wed Sep 10, 2014 9:12 pm
by Shawn
If I add count = 1 in the request parameters of the main query then I only get the count variable but not the result set
Do I need to add a new service only for the count ?
How to get count in query response
Posted: Wed Sep 10, 2014 11:21 pm
by Illya Stepanov
Hi Shown,
If the response is "count = 1" you'll get in return only count the items will not be included.