getThreadsByResourceId リファレンス
getThreadsByResourceId
関数は、特定のリソースIDに関連付けられたすべてのスレッドをストレージから取得します。
使用例
import { Memory } from "@mastra/core/memory";
const memory = new Memory(config);
const threads = await memory.getThreadsByResourceId({
resourceId: "resource-123",
});
パラメーター
resourceId:
string
スレッドを取得したいリソースのID。
戻り値
StorageThreadType[]:
Promise
指定されたリソースIDに関連付けられたスレッドの配列を解決するPromise。
関連情報
- Memory クラスリファレンス
- Memory のはじめ方(スレッド/リソースの概念を解説)
- createThread
- getThreadById