Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

ACS query pagination, get all matching objects

$
0
0

As stated in the docs;

"Prior to ACS 1.1.5, queries were paginated using page and per_page request parameters, and ACS would sort and limit the data in memory. This process is highly inefficient, especially if a query matched millions of objects. ..."

Instead query pagination is now done with the "where" parameter.

I understand it as if you're leaving out the per_page pagination on a query should return all matching objects?

For example:

Cloud.Objects.query({
        classname : 'Activity',
        where : {
            user_id : Titanium.App.Properties.getString('USER_ID'),
            workout : type,
        }
 
    }, function(e) {
 
        if (e.success) {
 
        }else{
 
        }
});
This only give me 10 results though. But setting page: 1 & per_page: 1000 on the query returns all the 200 objects.

Testing on iOS Simulator on Titanium SDK: 3.4.0 GA

Do i need to manually update the cloud module or something?


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>