-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Belongs To Many relation #36
Comments
We're loving it that vuex-orm already has a vue3 compatible branch, but yes -BelongsToMany (or many to many) would be a good addition. |
Can I ask what's this feature's priority and schedule? I'm trying to use next-vuex-orm in a new project and this would be very helpful. |
Sorry it's taking long 😓 Because in my use case most of the time I can just use |
Hm, I took a closer look at |
Just FYI - according the the docs @HasManyBy is a decorator - which works only in typescript? It may be unusual for a project with our level of complexity, but we don't use typescript. Or is it just that the docs aren't clear on this yet and I could use it without typescript? |
@smilingkite you may want to refer to this https://next.vuex-orm.org/guide/relationships/one-to-many.html#one-to-many-by |
Any traction on this? I've done some pretty whacky stuff with hasManyBy(), but there's a lot of holes in it that could be solved by bringing back many to many relationships in Vuex ORM. |
@kiaking Can you show example of HasManyBy for the inverse relation to "fake" belongsToMany? I tried this but because the ORM only stores 1 id for each relationship instead of a pivot table, this breaks when models have more than one ManyToMany relationships with eachother. |
What is the timeframe for implementing this and morphMany. I am anxious to use these features. |
Any update on this? In my opnion this was the best part about vuex-orm. For instance if you have Channels and Users you have Users.subscribed. The model in the middle UserSubbed can than be used to store a date for instance. This many to many missing is the only feature currenlty stopping me from upgrading my project. |
Ok turns out you don't actually need I made this issue on the pinia-orm repo with an example of how to convert a belongsToMany to HasMany. I hope this is helpful to everyone! |
Well i have a working version of it CodeDredd/pinia-orm#79 for pinia which can easly be added back here. I am happy to make an pr if its being merged. |
Ref: https://vuex-orm.org/guide/model/relationships.html#many-to-many
The text was updated successfully, but these errors were encountered: