Document how to model a many-to-many relationship
See original GitHub issueCurrently, you must explicitly model the join model.
Eventually, we will add a has_and_belongs_to_many
, similar to Rails.
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Many-to-many relationships - Django documentation
To define a many-to-many relationship, use ManyToManyField . In this example, an Article can be published in multiple Publication objects, and a Publication ......
Read more >MongoDB Many-to-Many Association - Stack Overflow
User - Create, Read, Update, Delete (CRUD operations like a free-standing entity). This can be modeled as the following document templates: User: {...
Read more >Many-to-Many Relationship in MongoDB - Model Intricate Data
This article shows you how to design many-to-many relationship in MongoDB ... MongoDB documentation writes only of how to model one-to-many ...
Read more >MongoDB Many-to-Many Relationship with Mongoose examples
Model Many-to-Many Relationships in MongoDB ... data models; Use Mongoose Model functions to create Documents; Populate referenced documents.
Read more >3. How to model many to many relationships? - Books by Agiliq
3. How to model many to many relationships?¶ ... A many-to-many relationship refers to a relationship between tables in a database when a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@morhook thank you. With the 3.x beta series underway this should much simpler very soon. You can follow along at https://github.com/samselikoff/ember-cli-mirage/pull/965
So I understand the “explicitly create a join model” but do not understand how I make this join model correctly translate to a 2 sided
hasMany
in ember data. Perhaps that is the sort of thing you are talking about documenting? Maybe something in the serializer? Below is the recommended setup I have gathered from the issues. Mirage models:And some fixtures:
With the ember data models being:
After reading through the issues the one thing I am missing is the best practice using mirage to wire up the
tags
andposts
asynchasMany
relations so it works with the ember data setup. From the declarations above I wouldn’t expectposts
ortags
to work in ember data so how do I go about that?