queryEvents( )


Creates a query to retrieve a list of Wix events.

The queryEvents() function builds a query to retrieve a list of Wix 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 that queryEvents.find() returns.

The query runs with the following EventsQueryBuilder defaults that you can override:

The functions that are chained to queryEvents() are applied in the order they are called. For example, if you sort on the _createdDate property in ascending order and then on the status property in descending order, the results are sorted first by the created date of the items and then, if there are multiple results with the same date, the items are sorted by status in descending order, per created date value.

The following EventsQueryBuilder functions are supported for queryEvents().

For a full description of the Wix Event object, see the object returned for the items property in EventsQueryResult.

PropertySupported Filters & Sorting
_ideq(), ne(), hasSome()
titleeq(), ne(), lt(), le(), gt(), ge(), hasSome(), contains(),ascending(), descending()
statuseq(), ne(), hasSome(), contains()
createdByeq(), ne(), hasSome()
scheduling.startDatelt(), le(), gt(), ge(), ascending(), descending()
scheduling.endDatelt(), le(), gt(), ge(), ascending(), descending()
_createdDateascending(), descending()
_updatedDateascending(), descending()
slugeq(), ne(), lt(), le(), gt(), ge(), hasSome(), contains(), ascending(), descending()

You can only use one filter function for each property. If a property is used in more than one filter, only the first filter will work.

Notes:

  • A guest can only see their own Wix events unless suppressAuth is set to true in the queryOptions for the find() function.
  • When using the queryEvents() function immediately following a change to your Wix events, the data retrieved may not contain your most recent changes. See Wix-data and Eventual Consistency for more information. To solve this problem, you can use the setTimeout() function to delay querying for a number of seconds, following any changes to your Wix events data.

Only those with "Manage Events" permissions can query Wix events. Only the events they are authorized to receive are returned.

Method Declaration
Copy
Request
This method does not take any parameters
Returns
Return Type:EventsQueryBuilder
Did this help?