xnhdev
CCConvex Community
•Created by xnhdev on 4/8/2024 in #support-community
Nested JSON
Hi team, I've searched to the best of my capabilities regarding nested json support.
The following is a sample JSON reply from an API, inside nextjs 14 (app router) , the idea is to write the response to Convex and subsequently reading it (reall response will include multiple elements in
"items"
array)
API JSON Response
I used "Add Document" (testing) in the dashboard and pasted it in and it was successfully loaded as one document with the field "items" auto generated including a single array that includes the raw API JSON response above
Field "items"
Few questions:
1. Is this a supported way to store a JSON reply?
2. if supported, can you read/query based on nested elements natively through Convex? for example returning something like but natively
3. I can query all and use regular javascript to filter, maybe that's the way to do it, more of a design question, but was hoping to do it at the source
4. tried the following, which undoubtly wrong but couldnt come up with better way, tried different variations, which just return []
5. Lastly, please tell me if there is something fundamentally missing from my understading of web app/db flow
Thanks!4 replies