跳到主要内容
非官方简体中文翻译,内容版权归 Mastra 所有,遵循 Apache-2.0 许可。

DatasetsManager.delete()

Added in: @mastra/core@1.4.0

Deletes a dataset by ID, including all of its items and versions. Experiments that ran against the dataset are kept but detached: their datasetId and datasetVersion are set to null. Database-backed storage adapters also remove the results of those experiments.

Usage example
Usage example的直接链接

import { Mastra } from '@mastra/core'

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

await mastra.datasets.delete({ id: 'dataset-id' })

Parameters
Parameters的直接链接

id:

string
ID of the dataset to delete.

Returns
Returns的直接链接

result:

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