Tip
このドキュメントはAIによって翻訳されました。不正確な情報については、英語版をご参照ください
RelationRepository
RelationRepository は、関連タイプのための Repository オブジェクトです。RelationRepository を使うと、関連をロードすることなく、関連データに対して操作を実行できます。RelationRepository をベースとして、各関連タイプに対応する派生実装が用意されています。具体的には以下の通りです。
HasOneRepositoryHasManyRepositoryBelongsToRepositoryBelongsToManyRepository
コンストラクター
シグネチャ
constructor(sourceCollection: Collection, association: string, sourceKeyValue: string | number)
パラメーター
基底クラスのプロパティ
db: Database
データベースオブジェクト
sourceCollection
関連における参照関係(referencing relation)に対応するコレクション
targetCollection
関連における被参照関係(referenced relation)に対応するコレクション
association
Sequelize における現在の関連に対応する association オブジェクト
associationField
コレクションにおける現在の関連に対応するフィールド
sourceKeyValue
参照関係におけるキー値

