View our GitHub

Please visit sails-docs on GitHub to view documentation on your mobile device.

Edit Page

Through Associations


Many-to-Many through associations behave the same way as many-to-many associations with the exception of the join table being automatically created for you. This allows you to attach additional attributes onto the relationship inside of the join table.

Unfortunately, they are not supported yet. Don't worry though, there's an easy workaround.

You can accomplish this by using an additional model as an intermediary. Instead of a many-to-many association between two models, you can use multiple one-to-many associations through the intermediary model.

Is something missing?

If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the sails-docs repo. Once we merge it, the changes will be reflected on the website the next time it is deployed.