The Axeda Platform has long had the ability to write custom logic to retrieve, manipulate and create data. In the current versions of the Platform, there are two classes of API, Version 1 (v1) and Version 2 (v2). The v1 APIs allow a developer to work with data on the Platform, but all of the APIs are subject to the maxQueryResults configuration property, which by default limits the number of results per query to 1000. For some subsets of data, this can be inadequate to process data. In comes the v2 API, which introduces pagination.
One of the first things a new user does when exploring the V2 API, is something like the following:
HistoricalDataItemValueCriteria criteria = new HistoricalDataItemValueCriteria()
I currently recommend that people avoid using the count() or countDomainObjectByCriteria() functions if you're then going to call a find. Currently both the count*() and find functions compute total results, and doubles execution time of just those two calls. Total count is only computed when running the first find() operation, so the code pattern above is so far the most efficient way I've seen to run these operations on the platform.
So having covered how to do this in code (custom objects), let's turn our attention to the REST APIs - the other entry-point for using these capabilities. The REST API doesn't offer a count*() function, but the first find() invocation (if using XML) brings back totalCount as part of the result set. You can use this in your application to decide how many times to call the REST end-point to retrieve your data. So for the example above:
And that's how you work around the maxQueryResults limitation of the v1 APIs. Some APIs do not currently have matching v2 Bridges (e.g. MobileLocation and DataItemAssociation), in which case the limitation will still apply. Creative use of the query Criteria will allow you to work around these limitations as we continue to improve the V2 API.