Skip to main content

dataset.deleteItem()

Added in: @mastra/core@1.4.0

Deletes a single item from the dataset by ID.

Usage example
Direct link to Usage example

import { Mastra } from '@mastra/core'

const mastra = new Mastra({
/* storage config */
})

const dataset = await mastra.datasets.get({ id: 'dataset-id' })

await dataset.deleteItem({ itemId: 'item-id' })

Parameters
Direct link to Parameters

itemId:

string
ID of the item to delete.

Returns
Direct link to Returns

result:

Promise<void>
Resolves when the item is deleted.
On this page