orderBy
The orderBy clause is used to define the property your database environment should order by. By default, LunaQL uses the _id property:
users.lunaql
query({
from({
users: {
orderBy("first_name");
};
});
});You can also pass the sort as the second argument.
users.lunaql
query({
from({
users: {
orderBy("first_name", "desc");
};
});
});💡
LunaQL uses
asc by default.You can also just use the sort clause to define how the sorting should work:
users.lunaql
query({
from({
users: {
sort("desc");
};
});
});