logologo
Get Started
Guide
Development
Plugins
API
Home
English
简体中文
日本語
한국어
Español
Português
Deutsch
Français
Русский
Italiano
Türkçe
Українська
Tiếng Việt
Bahasa Indonesia
ไทย
Polski
Nederlands
Čeština
العربية
עברית
हिन्दी
Svenska
Get Started
Guide
Development
Plugins
API
Home
logologo
API Overview

@nocobase/auth

AuthManager
Auth
BaseAuth

@nocobase/cli

NocoBase CLI
Global Environment Variables

@nocobase/client

Application
Plugin

@nocobase/database

Collection
Field

interfaces

BaseInterface
Filter Operators

RelationRepository

BelongsToManyRepository
belongs-to-repository
HasManyRepository
HasOneRepository
Repository

shared

create-options
destroy-options
find-one
find-options
transaction
update-options

@nocobase/flow-engine

DataSourceManager
FlowContext
FlowEngine
FlowModel
FlowResource

@nocobase/server

AppCommand
Application
AuditManager
Context
Migration
Plugin

@nocobase/sdk

Auth
Storage

@nocobase/telemetry

Metric
Telemetry
Trace
Previous PageFilter Operators
Next PageBelongsToManyRepository

#RelationRepository

RelationRepository is a Repository object for association types. RelationRepository allows operating on associated data without loading the association. Based on RelationRepository, each association type has a corresponding derived implementation:

  • HasOneRepository
  • HasManyRepository
  • BelongsToRepository
  • BelongsToManyRepository

#Constructor

Signature

  • constructor(sourceCollection: Collection, association: string, sourceKeyValue: string | number)

Parameters

Parameter NameTypeDefault ValueDescription
sourceCollectionCollection-The Collection corresponding to the referencing relation in the association
associationstring-Association name
sourceKeyValuestring | number-The corresponding key value in the referencing relation

#Base Class Properties

#db: Database

Database object

#sourceCollection

The Collection corresponding to the referencing relation in the association

#targetCollection

The Collection corresponding to the referenced relation in the association

#association

The association object in sequelize corresponding to the current association

#associationField

The field in the collection corresponding to the current association

#sourceKeyValue

The corresponding key value in the referencing relation