Returns the number of items in the current page of results.
length
returns just the number of items in the current page, not the total number of items that match the query. For the total number of items that match the query, see totalCount
.
The page size is defined by the limit()
function and can be retrieved using the pageSize
property. You can use the next()
and prev()
functions returned by itemVariants
to navigate the pages of a query result.
const resultLength = results.length;
const hasNext = results.hasNext();
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
const hasPrev = results.hasPrev();
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
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 and can be retrieved using the pageSize
property. You can use the next()
and prev()
functions returned by itemVariants
to navigate the pages of a query result.
If items are added or removed between calls to next()
, the values returned by VariantsQueryBuilder
may change.
function next(): Promise<VariantsQueryResult>;
const nextPage = results.next();
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
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 and can be retrieved using the pageSize
property. You can use the next()
and prev()
functions returned by itemVariants
to navigate the pages of a query result.
If items are added or removed between calls to prev()
, the values returned may change.
function prev(): Promise<VariantsQueryResult>;
const previousPage = results.prev();
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.