Search...
skip( )
Sets the number of items to skip before returning query results.
Description
The skip()
function defines the number of results to skip in the query
results before returning new query results.
For example, if you query a collection and 50 items match your query, but
you set skip
to 10, the results returned will skip the first 10 items
that match and return the 11th through 50th items.
By default, skip
is set to 0.
Syntax
function skip(skip: number): PublicPlansQueryBuilder
skip Parameters
NAME
TYPE
DESCRIPTION
skip
number
The number of items to skip in the query results before returning the results.
Returns
A PublicPlansQueryBuilder
object representing the refined query.
Return Type:
Was this helpful?
Add a skip to a query
Copy Code
1const query = wixPricingPlansBackend.queryPublicPlans().skip(10);
Create a query, add a skip, and run it
Copy Code
1import wixPricingPlansBackend from 'wix-pricing-plans-backend';23// ...45wixPricingPlansBackend.queryPublicPlans()6 .skip(10)7 .find()8 .then((results) => {9 if (results.items.length > 0) {10 const items = results.items;11 const firstItem = items[0];12 const totalCount = results.totalCount;13 const pageSize = results.pageSize;14 const currentPage = results.currentPage;15 const totalPages = results.totalPages;16 const hasNext = results.hasNext();17 const hasPrev = results.hasPrev();18 const length = results.length;19 const query = results.query;20 } else {21 // handle case where no matching items found22 }23 })24 .catch((error) => {25 const queryError = error;26 });