# How to order the results on a field?
- Construct the query using the collection's QueryBuilder class
- append the ordering to the query using
ascordescapi.
For example:
val employeeQry = EmployeeQuery().designation.is("SSE")
val sseOrderedByAge = employeeQry.dob.asc.find
Note: Without any query criteria, results will be returned by the storage engine in natural order (aka in the order they are found). Result order may coincide with insertion order but this behaviour is not guaranteed and cannot be relied on (aside from capped collections).
REFERENCE