Search.../

skip( )

Developer Preview

Sets the number of items to skip before returning query results.

Description

The skip() function defines the number of results to skip 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 first 10 items that match are ignored, and the 11th through 50th items are returned.

Syntax

function skip(skip: number): MembersQueryBuilder

skip Parameters

NAME
TYPE
DESCRIPTION
skip
Optional
number

Number of items to skip in the query results before returning the results.

Returns

Was this helpful?

Add a skip to a query

Copy Code
1const query = members.queryMembers.skip(10);
2
Create a query, add a skip, and run it

Copy Code
1import { members } from 'wix-members.v2';
2
3export async function myQueryFunction() {
4 const results = await members.queryMembers().skip(10).find();
5
6 if (results.items.length > 0) {
7 const items = results.items;
8 const firstItem = items[0];
9 const pageSize = results.pageSize;
10 const hasNext = results.hasNext();
11 const hasPrev = results.hasPrev();
12 const length = results.length;
13 const query = results.query;
14
15 return items;
16 } else {
17 // Handle if no matching items found
18 }
19}
20