Relations

The relations key defines relationships between models. Haska managing relations in you back-end services by set options as relations configs easily as below:

Key

Type

Description

foreignKey

String

Optional foreign key used to find related model instances.

ref(model)

String

Name of the related model. Required.

type

String

Relation type. Required.

hasMany

hasManyThrough and belongsTo

Filter

Object/Function

You can filter a relationship field using the filters option. { "type": "user" }

pageDatabase

Last updated