Skip to main content

Sorting

In this section we'll learn how to sort results

OrderAsc#

To sort result in ascending order use the OrderAsc function

db.Query(dqlx.HasFn("name")).
OrderAsc("name")

OrderDesc#

To sort result in descending order use the OrderDesc function

db.Query(dqlx.HasFn("name")).
OrderDesc("name")

Multiple Sorting#

You can chain multiple sorting criteria

db.Query(dqlx.HasFn("name")).
OrderDesc("name").
OrderAsc("age")