Search.../

queryEvents( )

Creates a query to retrieve a list of events.

Description

The queryEvents() function builds a query to retrieve a list of events and returns a EventsQueryBuilder object.

The returned object contains the query definition, which is typically used to run the query using the find() function.

You can refine the query by chaining EventsQueryBuilder functions onto the query. EventsQueryBuilder functions enable you to sort, filter, and control the results queryEvents() returns.

queryEvents() runs with these EventsQueryBuilder defaults, which you can override:

The functions that are chained to queryEvents() are applied in the order they're called. For example, if you apply ascending('title') and then descending('status'), the results are sorted first by the title, and then, if there are multiple results with the same title, the items are sorted by status.

PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),ne(),in(),ascending(),descending()
dateAndTimeSettings.startDateeq(),ne(),lt(),le(),gt(),ge(),in(),ascending(),descending()
dateAndTimeSettings.endDateeq(),ne(),lt(),le(),gt(),ge(),in(),ascending(),descending()
titleeq(),ne(),in(),ascending(),descending()
slugeq(),ne(),in(),ascending(),descending()
_createdDateeq(),ne(),lt(),le(),gt(),ge(),in(),ascending(),descending()
_updatedDateeq(),ne(),lt(),le(),gt(),ge(),in(),ascending(),descending()
statuseq(),ne(),in()
registration.initialTypeeq()
userIdeq(),ne(),in()

Syntax

function queryEvents(options: QueryEventsOptions): EventsQueryBuilder

queryEvents Parameters

NAME
TYPE
DESCRIPTION
options
Optional
QueryEventsOptions

Optional fields.

Returns

Return Type:

Was this helpful?

queryEvents example

Copy Code
1import { wixEventsV2 } from 'wix-events.v2';
2
3 async function queryEvents() {
4 const { items } = wixEventsV2.queryEvents().find();
5 }
6