> 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`). > - 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: Manage Items ## Article: Manage Items ## Article Link: https://dev.wix.com/docs/develop-websites-sdk/code-your-site/work-with-data/data-api/manage-items.md ## Article Content: # Manage Items You can use the Data Items API to create, update, and delete items in your collections. This guide covers the essential operations for managing your data. ## Insert items Use [`insert()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/insert.md) to add a new item to a collection. The method takes the collection ID and an object containing the item data and returns the newly created item. You can also specify your own custom `_id` when creating items. If you don't provide an `_id` field, the system automatically generates a random one for you. This example creates a new real estate listing in the `Listings` collection: ```javascript import { items } from "@wix/data"; const newListing = { _id: "listing-001", // Optional custom ID title: "Modern Downtown Apartment", price: 350000, bedrooms: 2, bathrooms: 1, squareFootage: 1200, status: "available", }; const result = await items.insert("Listings", newListing); console.log("Created listing:", result); ``` You can also use [`save()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/save.md) which inserts a new item if it doesn't exist, or updates an existing item if it does. ## Update items Use [`update()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/update.md) to modify existing items. The method takes the collection ID, item ID, and the complete item object to update and returns the updated item. Since `update()` replaces the entire item, you need to first have the existing item to avoid losing data in fields you don't intend to change: This example updates the price and status of an existing real estate listing in the `Listings` collection: ```javascript import { items } from "@wix/data"; // First, get the existing item const existingListing = await items.get("Listings", "listing-001"); // Then update it with the changes const updatedListing = { ...existingListing, price: 375000, status: "pending", }; const result = await items.update("Listings", "listing-id", updatedListing); console.log("Updated listing:", result); ``` You can also use [`patch()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/patch.md) for partial updates, or [`save()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/save.md) which updates an existing item if it exists, or inserts a new item if it doesn't. ## Remove items Use [`remove()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/remove.md) to delete items from a collection. The method takes the collection ID and the item ID and returns the deleted item. This example removes a real estate listing from the `Listings` collection: ```javascript import { items } from "@wix/data"; const result = await items.remove("Listings", "listing-001"); console.log("Removed listing:", result); ``` ## Bulk operations For multiple items, use the bulk methods for better performance. Each singular operation has a bulk equivalent. For example, to insert multiple items, use [`bulkInsert()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/bulk-insert.md): ```javascript import { items } from "@wix/data"; const listings = [ { title: "Cozy Studio", price: 180000, bedrooms: 0 }, { title: "Family Home", price: 450000, bedrooms: 3 }, { title: "Luxury Condo", price: 650000, bedrooms: 2 }, ]; const results = await items.bulkInsert("Listings", listings); console.log("Created listings:", results.results); ``` ## See also - [Query items](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/work-with-data/data-api/query-items.md) - [Data Items API](https://dev.wix.com/docs/sdk/backend-modules/data/items/introduction.md)