Search.../

prev( )

Retrieves the previous page of query results.

Description

The prev() function retrieves the previous page of query results.

The page size is defined by the limit() function, can be retrieved using the pageSize property, and navigating through pages is done with the prev() and next() functions.

If items are added or removed between calls to prev() the values returned by LabelsQueryResult may change.

Syntax

function prev(): Promise<LabelsQueryResult>

prev Parameters

This function does not take any parameters.

Returns

Fulfilled - The results of a contacts query, containing the retrieved items. When you execute a query with the find() function, it returns a Promise that resolves to a LabelsQueryResult object. This object contains the items that match the query, information about the query itself, and functions for paging through the query results.

Return Type:

Was this helpful?

Get the previous page of a query result

Copy Code
1const previousPage = oldResults.prev()
2 .then((results) => {
3 return results;
4 })
5 .catch((error) => {
6 console.error(error);
7 });