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
belongsToMany eager loaded association, unexpected object #2974
Comments
That's how join table attributes are included. You can remove the completely by using |
The reason is that we don't currently distinguish between join tables that only contain foreign keys and join tables that contain actual values. |
That indeed worked, thanks for the quick reply! I'll just leave here my POV on this matter:
Thanks again. |
Yeah i agree.
I agree aswell, but that's a major change that can be achieved by using the join model as an include (so not a big priority to change since it can be achieved trivially already) |
Also, there aren't any docs on this |
@miguelcobain hmm possibly not, we can be quite bad at not having the docs follow the code. |
Using
|
I have the following models with a belongsToMany relation:
Then I excute this and pass the result to the web framework I'm using (Hapi.js in my case):
The following json resulted:
The SQL query that is executed is:
What I'm not understanding is how the
UserRoles
object ended up on the eager loadedroles
array.I'm using PostgreSQL,
postgres
dialect,"pg": "^3.6.3"
and"sequelize": "^2.0.0-rc7"
.The text was updated successfully, but these errors were encountered: