Two-way Relationships
Two-way relationships are something that is not so intuitive, so let me explain here in detail.
As an example, we will have this setup:
Product
- Name
- Category (Relation to One)
- Unit Price
- Photos

Product.Category
Category
- Name
- Products (Relation to Many)

Category.Products
Product.Category is a two-way relationship to Category.Products, because when you change a Product.Category, it changes the Category.Products.
On products, we have Speaker and Headphone that belongs to the category Electronics.

In this case, the category form would look like this:
.png?alt=media&token=c197825a-3af8-452a-9fb7-6a5362340942)
Now let's suppose we remove Speaker from the Electronics category.
.png?alt=media&token=b9634a44-78a8-4752-9bc9-e83b146283da)
If we go back to products, we see that only Headphone is related to the Electronics category, because changing the products field, also impacted on the Product.Category records.
.png?alt=media&token=d18d00d4-7233-47f8-9ecf-1130f6f82406)
Last modified 2yr ago