Skip to main content

Page

You can paginate your query results by using the page modifier.

info

It paginates to the specified page number. In combination with limit, primarily used to paginate through your data.

If multiple page method calls are chained then the last one overwrites the previous page values.

// Query the database for the first page of 10 objects
let result = await altogic.db
.model("employee")
.filter('position == "Engineer" && department.code == 31415')
.omit("compensation", "benefit")
.sort("hireDate", "desc")
.limit(10)
.page(1)
.get();

Parameters

Here you can find parameters for the page modifier.

#

Name

Data type

Required

Description

1pageNumbernumberYesAn integer that specifies the page number.
caution

It throws an exception if pageNumber is not specified or if it is not a positive integer.