zumzum
zumzum

Reputation: 20238

parse, query with compound sort?

I am using parse for one of my iOS apps. I want to write a cloudCode function that I can call from the client that queries for objects of class "A". So, I know how to do that. What I am trying to figure out is if I can sort the query by two fields at the same time.

"A" has an "age field and a "count" filed.

I want to be able to get all "A" objects sorted by "age" and then by "count"

How can I setup such a query?

Upvotes: 0

Views: 277

Answers (1)

chasew
chasew

Reputation: 8828

In Cloud Code:

var query = new Parse.Query("A");
query.ascending("age,count");

Upvotes: 1

Related Questions