> Discover all available pages from the documentation index: https://mastra.zisheng.pro/zh-TW/llms.txt # dataset.updateItem() **新增於:** `@mastra/core@1.4.0` 更新資料集中的現有項目。僅更新提供的欄位。更新項目會建立新版本。 ## 使用範例 ```typescript import { Mastra } from '@mastra/core' const mastra = new Mastra({/* storage config */}) const dataset = await mastra.datasets.get({ id: 'dataset-id' }) const updated = await dataset.updateItem({ itemId: 'item-id', input: { question: 'What is TypeScript?' }, groundTruth: { answer: 'A typed superset of JavaScript' }, metadata: { reviewed: true }, }) ``` ## 參數 **itemId** (`string`): 要更新的項目 ID。 **input** (`unknown`): 更新後的輸入資料。 **groundTruth** (`unknown`): 更新後的 ground truth。 **metadata** (`Record`): 更新後的中繼資料。 ## 傳回值 **result** (`Promise`): 更新後的資料集項目。項目結構請參閱 dataset.addItem()。