> Discover all available pages from the documentation index: https://mastra.zisheng.pro/zh-HK/llms.txt # dataset.update() **新增於:** `@mastra/core@1.4.0` 更新資料集的元資料、名稱、描述及/或結構描述。 請使用 Standard JSON Schema(例如 Zod、Valibot、ArkType)定義結構描述。 ## 使用範例 ```typescript import { Mastra } from '@mastra/core' import { z } from 'zod' const mastra = new Mastra({/* storage config */}) const dataset = await mastra.datasets.get({ id: 'dataset-id' }) // Update with plain metadata const updated = await dataset.update({ name: 'Updated QA pairs', description: 'Revised evaluation set', }) // Update with Zod schema (library that supports Standard JSON Schema) const updated2 = await dataset.update({ inputSchema: z.object({ question: z.string(), context: z.string().optional(), }), }) ``` ## 參數 **name** (`string`): 新的顯示名稱。 **description** (`string`): 新的描述。 **metadata** (`Record`): 已更新的元資料。 **inputSchema** (`StandardJSONSchemaV1`): 項目輸入的 Standard JSON Schema。 **groundTruthSchema** (`StandardJSONSchemaV1`): 項目基準答案的 Standard JSON Schema。 ## 傳回值 **result** (`Promise`): 已更新的資料集記錄。 請參閱 dataset.getDetails() 了解完整結構。