> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name: or(query: EventsQueryBuilder)

# Method package: wixEventsBackend

# Method menu location: wixEventsBackend --> EventsQueryBuilder --> or

# Method Link: https://dev.wix.com/docs/velo/apis/wix-events-backend/wix-events/events-query-builder/or.md

# Method Description:

Adds an `or` condition to the query.

The `or()` function adds an inclusive `or` condition to an `EventsQueryBuilder`. A query
with an `or` returns all the items that match the query as defined up to
the `or` function, the items that match the query passed to the `or`
function, and the items that match both.

The `or()` function is designed to work with 2 or more queries.
If you use it on its own, it will return all the items in a collection.



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## Add an `or` filter to a query

```javascript
const newQuery = query1.or(query2);
```

## Create a compound query, with `and` and `or` filters, and run it

```javascript
import { wixEvents } from 'wix-events-backend';

// ...

const cutoffDate = new Date("2020-12-31");

const oldDateQuery = 
  wixEvents.queryEvents()
    .le("_createdDate", cutoffDate)
    .or(
      wixEvents.queryEvents()
      .lt("scheduling.endDate", cutoffDate)
    );

const slugQuery = 
  wixEvents.queryEvents()
    .contains("slug", "panel")
    .or(
      wixEvents.queryEvents()
        .contains("slug", "workshop")
    );

const outdatedQuery = oldDateQuery.and(slugQuery);

return wixEvents.queryEvents()
  .ne("status", "STARTED").and(outdatedQuery)
  .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;
      return items;
      // handle case where matching outdated panels
      // and workshops that 
      // are not in progress are found, 
      // such as deleting them
    } else {
      // handle case where no matching outdated 
      // panels and workshops are found, or 
      // they are still in progress
    }
  } )
  .catch( (error) => {
    const queryError = error;
  } );

/*
 * The results contain outdated events
 * (created or completed earlier than 
 * January 1, 2021) 
 * with slugs that contain  
 * "panel" or "workshop":
 *
 * climate-crisis-panel
 * basket-weaving-workshop
 * macrame-workshop
 * 
 * But not events that are currently 
 * in progress (status = "STARTED")
 */
```

---