Search.../

skip( )

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

Description

The number of items to skip in the query results before returning the results.

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: string): JoinRequestsQueryBuilder

skip Parameters

NAME
TYPE
DESCRIPTION
skip
string

The number of items to skip in the query results before returning the results.

Returns

A JoinRequestsQueryBuilder object representing the refined query.

Was this helpful?

Add a skip` to a query

Copy Code
1const query = joinRequests.queryJoinRequests().skip(10);
Create a query, add a skip, and run it

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { joinRequests } from 'wix-groups-backend';
3
4export const myQueryJoinRequestsFunction = webMethod(Permissions.Anyone, () => {
5
6 return joinRequests.queryJoinRequests()
7 .skip(10)
8 .find()
9 .then((results) => {
10 if (results.items.length > 0) {
11 const items = results.items;
12 const firstItem = items[0];
13 const pageSize = results.pageSize;
14 const totalPages = results.totalPages;
15 const totalCount = results.totalCount;
16 const currentPage = results.currentPage();
17 const next = results.next();
18 const previous = results.prev();
19 const hasNext = results.hasNext();
20 const hasPrev = results.hasPrev();
21 const length = results.length;
22
23 return items;
24 } else {
25 // Handle case where no matching items found
26 }
27 })
28 .catch((error) => {
29 console.error(error);
30 })
31
32});