Skip to main content

Pagination and sorting

Sorting and pagination commands in J1QL, such as ORDER BY, SKIP, and LIMIT, provide efficient ways to organize and navigate query results. By utilizing ORDER BY, you can sort entities based on specific fields, while SKIP allows you to skip a certain number of results, and LIMIT determines the maximum number of results to be returned. These commands enable fine-grained control over result presentation and facilitate targeted analysis of data.

note

That by default, queries will return up to 250 results if no LIMIT is specified.

In the example below, the query sorts users by their username and returns the 11th-15th users from the sorted list:

FIND Person WITH manager = undefined as u
ORDER BY u.username SKIP 10 LIMIT 5