reference property:
- Many-to-one / one-to-one: implemented via the
getfunction returning a single record - One-to-many / many-to-many: implemented by creating all CRUD routes on a router file
When the foreign key is accessible
If the foreign key already exists in your data:- Before (Node.js)
- After (Node.js)
- Before (Ruby)
- After (Ruby)
When you need complex logic to get the foreign key
If the foreign key doesn’t exist in your database and requires custom logic:- Create a computed field that contains the foreign key value
- Make that field filterable with the
Inoperator (required for relationships to work) - Declare the relationship using the computed field as the foreign key
If the foreign key exists in a related table but not the current one, use import field instead. It’s faster and natively filterable.
- Before (Node.js)
- After (Node.js)
- Before (Ruby)
- After (Ruby)