Search.../

skipTo( )

Developer Preview

Refines a query that skips to a specific record

Description

The skipTo() function refines a ServiceOptionsAndVariantssQueryBuilder that point to a specific record. You can get the relevant cursor token from cursors object in previous call's response. Not relevant fot the first request. Following requests use the cursor token and not a filter property

Syntax

function skipTo(cursor: string): ServiceOptionsAndVariantsListQueryBuilder

skipTo Parameters

NAME
TYPE
DESCRIPTION
cursor
Optional
string

A pointer to specific record

Was this helpful?

Perform a query and skip to next cursor

Copy Code
1import { serviceOptionsAndVariants } from 'wix-bookings.v2';
2
3export async function myQueryFunction() {
4 const results = await serviceOptionsAndVariants
5 .queryServiceOptionsAndVariants()
6 .find();
7
8 const nextCursor = results.cursors.next;
9 return serviceOptionsAndVariants
10 .queryServiceOptionsAndVariants()
11 .skipTo(nextCursor)
12 .find();
13}
14
Perform a query and get prev from the result

Copy Code
1import { serviceOptionsAndVariants } from 'wix-bookings.v2';
2
3export async function myQueryFunction() {
4 const results =
5 await serviceOptionsAndVariants.queryServiceOptionsAndVariants();
6 const prevCursor = results.cursors.prev;
7 return serviceOptionsAndVariants
8 .queryServiceOptionsAndVariants()
9 .skipTo(prev)
10 .find();
11}
12