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

Issue with skip, limit in ACS

$
0
0

I am having an issue trying to pull the correct custom objects from ACS. Here is the code that fetches the data from ACS:

Cloud.Objects.query({
        classname : 'products',
        count : true,
        skip : _args.skip,
        limit : _args.limit,
        where : {
            "coordinates" : {
            "$nearSphere" : [_args.longitude, _args.latitude],
            "$maxDistance" : convertToRadians(_args.maxDistanceMiles)
        }
        },
        order : "-updated_at"
    }, function(e) {
        if (e.success) {
            _args.success(e);
        } else {
            _args.failure(e);
        }
    });

On success i output the skip, limit, and ID of the first object. As you can see the ID is always the same even though I am changing the skip and limit.

[INFO] :   skip: 0
[INFO] :   limit: 4
[INFO] :   54d19fa308c91ec27625e86d
[INFO] :   Marker Reached (Dynamic loading)
[INFO] :   skip: 4
[INFO] :   limit: 4
[INFO] :   54d19fa308c91ec27625e86d
[INFO] :   Marker Reached (Dynamic loading)
[INFO] :   skip: 8
[INFO] :   limit: 4
[INFO] :   54d19fa308c91ec27625e86d
[INFO] :   Marker Reached (Dynamic loading)
[INFO] :   skip: 12
[INFO] :   limit: 4
[INFO] :   54d19fa308c91ec27625e86d

The goal I am trying to achieve is getting custom objects that are within a certain distance but most importantly ordered by the time they were updated on. Is this not possible or am I doing something wrong?


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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