How to get total count using query.v1

122 views
Skip to first unread message

Adam Anderson

unread,
Jan 8, 2014, 1:36:39 PM1/8/14
to version...@googlegroups.com
Using the rest-1.v1/Data endpoint, it was possible to get a page of results with the total count of all results:

/rest-1.v1/Data/Member?page=2,0
<Assets total="4" pageSize="2" pageStart="0">

Is this possible using the query.v1 endpoint?

A simple paged query doesn't return the total count:

{
  "from": "Story",
  "page":
    {
      "start":0,
      "size":2
    }
}

[
    [
        {
            "_oid": "Story:1007"
        },
        {
            "_oid": "Story:1015"
        }
    ]
]

I've seen the @Count parameter used to count the number of objects in a relation, but I don't see how to use it to count the total number of results.

Thanks

Adam Anderson

unread,
Mar 18, 2014, 8:30:18 PM3/18/14
to version...@googlegroups.com
Is this functionality not supported?

This is a pretty basic feature for paging queried data.

In case this group is no longer monitored, I posted this question to StackOverflow

I appreciate any input,
Thanks

Adam Anderson

unread,
Jun 24, 2014, 9:35:31 PM6/24/14
to version...@googlegroups.com
One last bump to see if anyone has any ideas or if this feature is being considered for future support.

Adam Anderson

unread,
Jul 16, 2014, 10:15:32 PM7/16/14
to version...@googlegroups.com
Got some help with this on StackOverflow: http://stackoverflow.com/a/24793776/682803

Turns out you can do some down-casting, filtering, and aggregation like this:
"Workitems:Task[Parent='Story:1007'].@Count"
Reply all
Reply to author
Forward
0 new messages