Search.../

skip( )

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): JoinGroupRequestsQueryBuilder

skip Parameters

NAME
TYPE
DESCRIPTION
skip
Optional
number

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

Was this helpful?

Add a skip to a query

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

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