SKIP
enables the return of only subsets of the total result.
By using SKIP
, the result set will get trimmed from the top.
Please note that no guarantees are made on the order of the result unless the query specifies the ORDER BY
clause.
Graph
To return a subset of the result, starting from the fourth result, use the following syntax:
Query
START n=node(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 in the result.
Try this query live. (1) {"name":"D"} (2) {"name":"E"} (3) {"name":"A"} (4) {"name":"B"} (5) {"name":"C"} (3)-[:KNOWS]->(4) {} (3)-[:KNOWS]->(5) {} (3)-[:KNOWS]->(1) {} (3)-[:KNOWS]->(2) {} start n=node(3, 4, 5, 1, 2) return n order by n.name skip 3
To return a subset of the result, starting from somewhere in the middle, use this syntax:
Query
START n=node(3, 4, 5, 1, 2) RETURN n ORDER BY n.name SKIP 1 LIMIT 2
Two nodes from the middle are returned.
Try this query live. (1) {"name":"D"} (2) {"name":"E"} (3) {"name":"A"} (4) {"name":"B"} (5) {"name":"C"} (3)-[:KNOWS]->(4) {} (3)-[:KNOWS]->(5) {} (3)-[:KNOWS]->(1) {} (3)-[:KNOWS]->(2) {} start n=node(3, 4, 5, 1, 2) return n order by n.name skip 1 limit 2
Copyright © 2012 Neo Technology