This example shows you how to search on a smart field which display a belongsTo smart relationship.
We have an order which belongsTo a customer which hasOneaddress.
We’ve created a Smart Relationship (delivery address)on the order table that acts like a shortcut between the order and the address.
Requirements
An admin backend running on forest-express-sequelize
How it works
Directory: /models
This directory contains the orders.js , customers.js and addresses.js files where the models are declared.
This directory contains the orders.js file where the BelongsTo Smart Relationship delivery_addressis declared.
A belongsTo Smart Relationship is created like a Smart Field with the reference option to indicates on which collection the Smart Relationship points to.
As for Smart Field, the search is not supported by default. So we'll have to implement the logic using Sequelize querying methods.