Skip to content
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

the mounted property type of arbitrary join #417

Open
cyjake opened this issue Dec 20, 2023 · 0 comments · May be fixed by #418
Open

the mounted property type of arbitrary join #417

cyjake opened this issue Dec 20, 2023 · 0 comments · May be fixed by #418

Comments

@cyjake
Copy link
Owner

cyjake commented Dec 20, 2023

What should the typeof post.comments in following query be?

await Post.findAll().join(Comment, 'comments.postId = posts.id')

currently it's Array<Post { id, comments: Comment { id, content } }>, although I thought the joined comments should be Array as well, namely Array<Post { id, comments: Array<Comment { id, content }> }>

a more detailed example:

// current
[{ "id": 1, comments: { "id": 42, "content": "sofa" } }]

// expected
[{ "id": 1, comments: [{ "id": 42, "content": "sofa" }, { "id": 56, "content": "stool" }] }

this change requires major version bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant