Like what we’re doing? Star us on GitHub!

Best way to handle many-to-many relationship?

bombnp
4 months ago
7

Say, I have two collections:

Books

and

Tags

. A book can have many tags, and a tag can be assigned to multiple books. When a book is tagged via relationship field (

tags

), I want the tag's relationship field (

books

) to be updated accordingly (create/update/delete). Im not sure to do that as of now. Any ideas?

  • jmikrut
    Payload Team
    4 months ago

    Hey @bombnp check the #plugins channel— the community has built a plugin to do exactly this for you!

  • bombnp
    4 months ago
  • jmikrut
    Payload Team
    4 months ago

    yes!

  • TheDunco
    last month

    Are there plans to officially support this? The repo states it's not ready for production (and in pre-alpha), but I would really like to use this feature in a production application

  • jmikrut
    Payload Team
    last month

    yes it will be officially supported



    we have to tackle additional database support before diving in here much more deeply

  • TheDunco
    4 weeks ago

    Cool! For now I've gotten it working but had to do some custom modifications and clean-up

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More