find( )


Returns the items that match the query.

The find() function returns a Promise that resolves to the results found by the query and some information about the results. The Promise is rejected if find() is called with incorrect permissions or if any of the functions used to refine the query are invalid.

Note: A guest can only view their own events. You can override the permissions by setting the suppressAuth option to true.

Method Declaration
Copy
function find(options: QueryOptions): Promise<EventsQueryResult>;
Method Parameters
optionsQueryOptions

Options to use when performing a query or query count.

Returns
Return Type:Promise<EventsQueryResult>
JavaScript
import { wixEvents } from "wix-events-backend"; // ... wixEvents .queryEvents() .find() .then((results) => { if (results.items.length > 0) { const items = results.items; const firstItem = items[0]; const totalCount = results.totalCount; const pageSize = results.pageSize; const currentPage = results.currentPage; const totalPages = results.totalPages; const hasNext = results.hasNext(); const hasPrev = results.hasPrev(); const length = results.length; const query = results.query; } else { // handle case where no matching items found } }) .catch((error) => { const queryError = error; });
Did this help?

ge( )


Refines a query to match items whose specified property value is greater than or equal to the specified value.

The ge() function refines an EventsQueryBuilder to only match items where the value of the specified property is greater than or equal to the specified value.

It only matches values of the same type. For example, a number value stored as a String type does not match the same number stored as a Number type.

If a property contains a number as a String, that value will be compared alphabetically and not numerically. Items that do not have a value for the specified property are ranked lowest.

The following types of properties can be compared:

  • Number: Compares numerically.
  • Date: Compares JavaScript Date objects.
  • String: Compares lexicographically, "abc" is greater than or equal to "ABC" (because of the greater than), but "ABC" is not greater than or equal to "abc"
Method Declaration
Copy
function ge(propertyName: string, value: union): EventsQueryBuilder;
Method Parameters
propertyNamestringRequired

The property whose value will be compared with value.

Supported properties:

  • scheduling.startDate
  • scheduling.endDate
  • title
  • slug

valueunionRequired

The value to match against.

Returns
Return Type:EventsQueryBuilder
JavaScript
const query = wixEvents .queryEvents() .ge("_updatedDate", "2020-04-27T10:00:00.000Z");
Did this help?