-
Notifications
You must be signed in to change notification settings - Fork 5
SKIP clause
Marijn van Wezel edited this page Dec 15, 2022
·
1 revision
The SKIP
clause defines from which row to start including the rows in the output. It takes the number of rows to skip.
Query::skip(int|IntegerType $amount): Query
-
$amount
: The amount to skip.
-
setSkip(int|IntegerType $skip): self
: Set the amount to skip.
$n = node();
$query = query()
->match($n)
->returning($n->property('name'))
->orderBy($n->property('name'))
->skip(3)
->build();
$this->assertStringMatchesFormat("MATCH (%s) RETURN %s.name ORDER BY %s.name SKIP 3", $query);
$n = node();
$query = query()
->match($n)
->returning($n->property('name'))
->orderBy($n->property('name'))
->skip(1)
->limit(2)
->build();
$this->assertStringMatchesFormat("MATCH (%s) RETURN %s.name ORDER BY %s.name SKIP 1 LIMIT 2", $query);
$n = node();
$query = query()
->match($n)
->returning($n->property('name'))
->orderBy($n->property('name'))
->skip(integer(5)->exponentiate(2))
->build();
$this->assertStringMatchesFormat("MATCH (%s) RETURN %s.name ORDER BY %s.name SKIP (5 ^ 2)", $query);