> 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

## Resource: Items

## Type: WixDataBulkPatch

## Article: Introduction

## Article Link: https://dev.wix.com/docs/sdk/data-items-sdk/data/items/wix-data-bulk-patch/introduction.md

## Article Content:

# Introduction

The `WixDataBulkPatch` methods enable you to specify the modifications you want to apply to one or more data items. You can apply multiple modifications to each item.

Build a bulk patch operation by calling the [`bulkPatch()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/bulk-patch.md) method on the data items, and refine it by chaining `WixDataBulkPatch` modification methods onto it. You can set or increment a field value,remove it altogether, or add to or remove items from an array field. The methods are applied in the order in which they are chained.

Finally, run the patch operation by calling [`run()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-patch/run.md).

> **Notes**:
>
> - You must chain at least one `WixDataBulkPatch` method before calling [`run()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-patch/run.md).
> - You can only patch items in [collections created by Wix users](https://support.wix.com/en/article/cms-formerly-content-manager-creating-a-collection). Items in [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code.md) cannot be patched.

For example, the following code patches two costume items by adding sizes, removing a color option, and marking them as available:

```javascript
import { items } from '@wix/data'

async function patchCostume() {
  const patchedCostumes = items
    .bulkPatch("costumes", ["fb071093-9a40-432d-ae1f-2e5966fecbfa", "9fe1a67f-fc60-4e99-8898-3f9e719ca62f"])
    .appendToArray("sizes", "L")
    .appendToArray("sizes", "XL")
    .removeFromArray("colors", "black")
    .setField("available", true)
    .run();
}

  const ids = patchedCostumes.updatedItemIds; // ["fb071093-9a40-432d-ae1f-2e5966fecbfa", "9fe1a67f-fc60-4e99-8898-3f9e719ca62f"]
  const inserted = patchedCostumes.inserted; // 0
  const updated = patchedCostumes.updated; // 2
  const errors = patchedCostumes.errors; // []

```
