Limits and offsets
The second argument to .query()
allows you to specify a limit and offset on the query.
limit
: The maximum number of records to be returned.
offset
: The offset of the first item to be returned.
By specifying both a limit and an offset, we can paginate through a list of records.
const queryResult = await movies.query(
movie => movie.title.match("the"),
{
limit: 20,
offset: 10,
order: [
{ byIndex: "runningTime", direction: "ASC"}
]
}
)