Returns the items that match the query.
The current page of Wix events retrieved by the query.
Note: When no items match the query, the items
array is empty.
To paginate your query results, use the EventsQueryResult
pagination properties and functions.
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;
});