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

Can I get nested json response in case of SQL queries containing joins? #152

Open
ancode4 opened this issue Sep 18, 2020 · 0 comments
Open
Assignees

Comments

@ancode4
Copy link
Member

ancode4 commented Sep 18, 2020

Eg: If I have a query _SELECT userid, name, pet_name, pet_type from users left join pets on pets.userid=users.userid

I get the response as
[ { "id": 1, "name": "Anish", "pet_name": "Meow", "pet_type": "Cat" }, { "id": 1, "name": "Anish", "pet_name": "Sparky", "pet_type": "Dog" } ]

Note here that the record is repeated for the join value. Can I instead get a nested json array for the repeated records? This way
[ { "id": 1, "name": "Anish", "pet_name": ["Meow","Sparky"], "pet_type": ["Cat","Dog"] } ]

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

No branches or pull requests

2 participants