Offset operator
The offset operator skips rows until the specified number has been skipped, then produces the remaining rows as normal.
Example
Schema for the following examples
#!test[schema, commit]
define
entity content owns id;
entity page sub content,
owns page-id,
owns name;
entity profile sub page,
owns username;
entity user sub profile,
owns phone,
owns karma;
attribute id value string;
attribute page-id sub id;
attribute username sub page-id;
attribute name value string;
attribute phone value string;
attribute karma value double;
attribute start-date, value date;
relation friendship relates friend @card(0..2), owns start-date;
user plays friendship:friend;
Retrieve all friends of a user, sorted by the time they became friends from earliest to latest. Skip first 10, then return the following 10.
This can be thought as retrieving the second page with 10 employees per page.
#!test[read]
match
$user isa user, has name "<name>";
friendship (friend: $user, friend: $friend),
has start-date $start;
sort $start;
offset 10;
limit 10;