4.8. Skip

4.8.1. Skip first three
4.8.2. Return middle two

Skip enables the return of only subsets of the total result. By using skip, the result set will trimmed from the top. Please note that no guarantees are made on the order of the result unless the query species the order by clause.

4.8.1. Skip first three

To return a subset of the result, starting from third result, use this syntax:

Query

start n=(3, 4, 5, 1, 2) return n order by n.name skip 3

The first three nodes are skipped, and only the last two are returned.

Result

 +--------------------+
 | n                  |
 +--------------------+
 | Node[1]{name->"D"} |
 | Node[2]{name->"E"} |
 +--------------------+
 2 rows, 1 ms

4.8.2. Return middle two

To return a subset of the result, starting from somewhere in the middle, use this syntax:

Query

start n=(3, 4, 5, 1, 2) return n order by n.name skip 1 limit 2

Two nodes from the middle are returned

Result

 +--------------------+
 | n                  |
 +--------------------+
 | Node[4]{name->"B"} |
 | Node[5]{name->"C"} |
 +--------------------+
 2 rows, 1 ms