Warning:
Fauna is decommissioning FQL v4 on June 30, 2025.
This driver is not compatible with FQL v10, the latest version. Fauna accounts created after August 21, 2024 must use FQL v10.
Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-jvm.
For more information, see the v4 end of life (EOL) announcement and related FAQ.
public final class Pagination extends Expr
Example: We can paginate all instances of a class, with its evets, in pages with 4 elements only.
client.query(
Paginate(Match(Ref("indexes/all_spells"))
.withEvents(true)
.withSize(4)
);
Language.Paginate(Expr),
FaunaDB Read Functions| Modifier and Type | Method and Description |
|---|---|
Pagination |
after(Expr cursor)
Sets the cursor of the pagination to move forward.
|
Pagination |
before(Expr cursor)
Sets the cursor of the pagination to move backwards.
|
Pagination |
events(boolean events)
Define if the pagination should include events of not
|
Pagination |
events(Expr events)
Define if the pagination should include events of not
|
Pagination |
size(Expr size)
Sets the size of the pagination
|
Pagination |
size(Integer size)
Sets the size of the pagination
|
Pagination |
sources(boolean sources)
Define if the pagination should include sources of not
|
Pagination |
sources(Expr sources)
Define if the pagination should include sources of not
|
protected ImmutableMap<String,Expr> |
toJson() |
Pagination |
ts(Expr ts)
Sets the timestamp for the pagination
|
Pagination |
ts(Long ts)
Sets the timestamp for the pagination
|
protected ImmutableMap<String,Expr> toJson()
public Pagination before(Expr cursor)
cursor - the cursorpublic Pagination after(Expr cursor)
cursor - the cursorpublic Pagination ts(Expr ts)
ts - the desired timestamppublic Pagination ts(Long ts)
ts - the desired timestamppublic Pagination size(Expr size)
size - the desired sizepublic Pagination size(Integer size)
size - the desired sizepublic Pagination sources(Expr sources)
public Pagination sources(boolean sources)
public Pagination events(Expr events)
public Pagination events(boolean events)