Skip to content

the mounted property type of arbitrary join Β #417

@cyjake

Description

@cyjake

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions