Closed demisx closed 9 years ago
Is it not parsed back to an array by node-postgres?
I am not using node-postgres
at all. Do I need to?
Sorry, didn't realize that pg
was the node-postgres
. Yeah, I am using it, but API still responds with the Postgres version of the JSON array. Is this something that needs to be converted by the pg
?
What does that mean? Because it parses json fine. But yeah response parsing is handled by the db driver.
OK. I will file an issue with node-postgres
then. Thank you.
FYI, looks like there is no JSON array parsing in node-postgres
yet. See https://github.com/brianc/node-postgres/pull/456#issuecomment-75909527. Please fill free to chime in, if you can recommend a good parsing library that Brian is asking about.
Hi Ben, Wondering what your thought is about this. I have a
jsonb[]
typephotos
column in my table created as:This column will store array of JSON objects. Currently, when I seed it with this data:
PostgreSQL 9.4 stores it as:
Can you please recommend the best approach to convert this Postgres' representation of JSON array to the conventional
[{...}, {...}, ...]
kind and the layer where it should be done at (e.g. Postgres, Bookshelf, Angular)? The API returns this filed to the AngularJS frontend and I want Angular to be able to see the conventional kind, not the Postgres version of it. I've tried to find similar scenarios online, but couldn't so far.Thank you.