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

Can't Query ACS Custom Objects in Right Order

$
0
0

I am having an issue where I can't seem to query ACS custom objects by row in the correct order. On one table I am trying to query custom objects in ascending order by most occurrences. The second table I am trying to query events in ascending order by most recent event creation time. I am trying to use the "order" property to sort my queries, but this isn't working. Every time I try to refresh the table I am given a random order. Sometimes it is correct, other times it is completely random. Any help would be great.

Full Code: http://pastebin.com/r115FHDH

Custom Object Query by Most Occurrences:

Cloud.Objects.query({
            classname : 'topEvents',
            where : {
                bar_name : event.custom_fields.bar_name
            },
            // "order": "-id"
Events Query by Most Recent Time:
Cloud.Events.queryOccurrences({
                    where : {
                        "start_time" : {
                            $gte : previous_day_date
                        }
 
                    },
                     "order":"id, created_at"
                    //"order" : "created_at"

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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