How to dinstinguish between json object and json array #1305
Unanswered
JamesInform
asked this question in
Q&A
Replies: 1 comment
-
|
Internally, it is calling In particular scan into var js any
...
rows.Scan(&js) |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
In PostgreSQL a json / jsonb field can store both, a json object as well as a json array.
What is the best solution to scan a row in pgx if you don't know ahead if a queried json is an object or an array?
This seems to only work for json array:
This seems to only work for json objects:
Is there a universial solutions for handling json in pgx?
Cheers,
James
Beta Was this translation helpful? Give feedback.
All reactions