Parse.Query sort by date

10,345

Yes, that is fine... but the string name of the Users class is not Users, it's "_Users".. better still: new Parse.Query(Parse.User);

var userQuery = new Parse.Query(Parse.User);
userQuery.ascending("createdAt");

But... Your user class should not be user queryable. This should be locked down in the class-level permissions section of the data browser, and only Cloud Code using the Master Key should be able to query users.

Share:
10,345
user1324887
Author by

user1324887

Updated on June 13, 2022

Comments

  • user1324887
    user1324887 almost 2 years

    Is there a way to sort by createdAt time in parse?

    For example:

    var Users = Parse.Object.extend("Users"),
        Query = Parse.Query;
    
    var userQuery = new Query(Users);
    
    userQuery.equalTo("userName", Name);
    
    userQuery.ascending("createdAt");