You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi~
Two models is associated by belongsToMany function, eg: Project.belongsToMany(User, { through: UserProject }) , I can get all user datas which are associated with the project by project.getUsers() . However, the join table will be selected by inner join at the same time. I hope to prevent that.
AnyOne, who can help me ? Thanks inadvance.
Keeping inner join when select, the data of userProjects table(not users or projects) doesn't be returned when i select. Can do this by some settings? @mickhansen
Activity
mickhansen commentedon Jul 7, 2016
Join table has to be selected by inner join, otherwise you can get inconsistent data with paranoid join tables.
Not possible to disable, not sure why you'd need to (it should be scoped so it doesn't have any effect on the rest).
Show SQL you think might be incorrect.
mickhansen commentedon Jul 7, 2016
@JasonFang93 Not sure i understand
JasonFang93 commentedon Jul 7, 2016
That is to say, I hope to reduce the size of the data which I have selected. I get. Thanks ~
JasonFang93 commentedon Jul 7, 2016
Keeping inner join when select, the data of userProjects table(not users or projects) doesn't be returned when i select. Can do this by some settings? @mickhansen
mickhansen commentedon Jul 7, 2016
include.through.attributes = []is supposed to work, but doesn't atm (needs to be fixed)JasonFang93 commentedon Jul 7, 2016
Thanks , let me try~ @mickhansen