Open spersico opened 5 years ago
This is being researched in the @kurier/addon-many-to-many
package.
Alright, here's a built-in implementation of manyToMany
relationships feature/many-to-many, myself and @Martinarbez are working on a project that implements Kurier, but it was lacking this critical feature, we'll be happy to receive commentaries 🙏🏻 and hopefully get this feature landed on the package.
I believe that this could be done in a couple of ways:
Through the support of n-depth nested resources, and nested resources operations: So if I have an author model, a book model and a authorsBook model relating both, I can just delete an authorsBook (explicitly) and that's it. Or for GET operations, I can get to the books through authorsBook.
Tough more... blackboxy? magicky?, another aproach could be something like this: https://loopback.io/doc/en/lb3/HasAndBelongsToMany-relations.html Where the user wouldn't have direct access to the junction-table, and the operations would be transparent to the user.