const Product = AV.Object.extend('Product'); const query = new AV.Query(Product); query.ascending('name'); query.find().then(products => { // Do something with the products }).catch(console.error);
const User = AV.Object.extend('User'); const query = new AV.Query(User); query.ascending('age'); query.find().then(users => { // Do something with the users }).catch(console.error);In this example, we're querying the `User` class and sorting the results in ascending order of the `age` field. These examples use the leancloud-storage package library, which is used to communicate with LeanCloud's backend services.