- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
belongsTo Relationship Method - DML Reference
This method defines the inverse of the hasOne or hasMany relationship.
For example, a product "belongsTo" a store.
Example#
Type Parameters#
T
objectOptionalThe type of the entity builder passed as a first parameter. By default, it's
a function returning the related model.
ForeignKeyName
undefined | stringOptionalParameters#
entityBuilder
TA function that returns the data model this model is related to.
options
object & Record<string, any> & objectOptionalThe relationship's options.
options
object & Record<string, any> & objectOptionalWas this page helpful?