Search.../

hasPrev( )

Indicates whether the query has previous results.

Description

You can use the next() and prev() functions returned by guests to navigate the pages of a query result.

Syntax

function hasPrev(): boolean

hasPrev Parameters

This function does not take any parameters.

Returns

Return Type:

boolean

Was this helpful?

Get whether the query has previous results

Copy Code
1const hasPrev = results.hasPrev();
2
Perform a query and get hasPrev from the result

Copy Code
1import { guests } from 'wix-events.v2';
2
3export async function myQueryFunction() {
4 const results = await guests.queryGuests().find();
5
6 return results.hasPrev();
7}
8