Paged list
Log in to add to favouritesA paged list is a structure that is used to describe paging details for listing and search results.
Properties
Name | Type | Format | Description |
---|---|---|---|
pageIndex | number | int | The index of the result set to return. |
pageSize | number | int | The size of the result set to return. The default is 25. |
totalCount | number | int | The total number of results available. |
pageCount | number | int | The calculated page count based on the totalCount and pageSize. |
items | object […] | A container for the items being returned. |
Example
The paged list properties provide the information required to implement paging.
const { Query, Op } = require("contensis-delivery-api");
const query = new Query(
Op.equalTo("sys.contentTypeId", "<content_type_id>"),
Op.equalTo("sys.versionStatus", "published")
);
ContensisClient.entries.search(query).then(function (entryList) {
// Items
entryList.items.forEach(item => (
console.log(item.entryTitle)
))
// Page details
console.log(entryList.pageIndex)
console.log(entryList.pageSize)
console.log(entryList.totalCount)
console.log(entryList.pageCount)
});