When you execute a query with the find()
function, it returns a Promise that resolves to a ContactsQueryResult
object.
This object contains the items that match the query, information about the
query itself, and functions for paging through the query results.
Returns the items that match the query.
The current page of items retrieved by the query.
List of contacts.
Note: When no items match the query, the items array is empty.
To paginate your query results, use the ContactsQueryResult
pagination properties and functions.
Returns the ContactsQueryBuilder
object used to get the current results.
Use the query
property to create and run a new query
by chaining additional ContactsQueryBuilder
functions to it.
Indicates if the query has more results.
Indicates if the query has previous results.
Retrieves the next page of query results.
The next()
function retrieves the next 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 next()
the values returned
by ContactsQueryResult
may change.
Retrieves the previous page of query results.
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 ContactsQueryResult
may change.
function prev(): Promise<ContactsQueryResult>;
const previousPage = oldResults
.prev()
.then((results) => {
return results;
})
.catch((error) => {
console.error(error);
});