Search...
skipTo( )
Developer Preview
Refines a query that skips to a specific record.
Description
The skipTo()
function refines a ReservationLocationsQueryBuilder
to return items that appear before or after the item pointed to by the provided cursor. Get the relevant cursor for a specific item from the cursors
object in previous call's response. Then you can skip to cursors.prev
to return items before the cursor, or cursors.next
to return items after the cursor.
When using skipTo()
, the filters and the sorting order of the original query can't be changed. Only the limit()
property of the query can be changed.
Syntax
function skipTo(cursor: string): ReservationLocationsQueryBuilder
skipTo Parameters
NAME
TYPE
DESCRIPTION
cursor
Optional
string
A pointer to specific record
Returns
Return Type:
Was this helpful?
Perform a query and skip to the next cursor
Copy Code
1import { reservationLocations } from 'wix-table-reservations.v2';23export async function myQueryFunction() {4 const results = await reservationLocations.queryReservationLocations().find();56 const nextCursor = results.cursors.next;7 return reservationLocations8 .queryReservationLocations()9 .skipTo(nextCursor)10 .find();11}12
Perform a query and skip to the previous cursor
Copy Code
1import { reservationLocations } from 'wix-table-reservations.v2';23export async function myQueryFunction() {4 const results = await reservationLocations.queryReservationLocations().find();56 const prevCursor = results.cursors.prev;7 return reservationLocations8 .queryReservationLocations()9 .skipTo(prevCursor)10 .find();11}12