Search
addItems
Add new items to this Collection, or update existing ones if their IDs match.
// Create a new item await collection.addItems([{ slug: "eric", fieldData: { [nameField.id]: { type: "string", value: "Eric" }, [ageField.id]: { type: "number", value: 47 }, }, }]) // Update an existing item await collection.addItems([{ id: "aBc123", slug: "bar" }])
If an
idis provided and matches an existing item, that item will be updated.Items without an
idare created as new records.slugshould be unique.
Parameters
items:CollectionItemInput[]– An array of items to add or update.
Returns
Promise<void>