Quick question: If I got 2 models (User & Frui...
# orm-help
g
Quick question: If I got 2 models (User & Fruit) and I want Users to be able to share what Fruit they like (i.e. User1 likes Apples User2 likes Apples and Banana), how exactly would you do so? I'm unsure if it's an One-to-Many or Many-to-Many I need here
s
Many to many, behind the scene you would need another table. Table example: [id][userId][FruitId]
g
Aha! Thanks a bunch! Would the example provided by prisma be good enough?
s
Sorry, not familiar with that example, however, I’m sure it will.
g
Gotcha!