Replies: 1 comment
-
let object = await d1....
object.images = JSON.parse(object.images) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
exoup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Using a D1 database and given the following object as input:
I use
json_extract
to extract the json in my response, but only the top-level values are returned appropriately.Instead, for instance with images, I receive a text response like this:
'{"full":"","thumbnail":"","foilMask":"","local":"2rQAni2KRIW_2L3OQDnrc"}'
Currently I'm using a SQL query like this:
SELECT json_extract(jsonText, '$') FROM Table ORDER BY random() LIMIT 1
just for testing.What do I need to do in order to return the nested text as an object?
I see this same issue when creating generated columns like
images AS (json_extract(jsonText, '$.images')) STORED,
Beta Was this translation helpful? Give feedback.
All reactions