AnsweredAssumed Answered

How can I return many rows from a table as one key (array) on an JSON obj?

Question asked by mgoetz on May 1, 2018
Latest reply on May 3, 2018 by 51662476

I would just like to take n number of rows from a postgres table and return to the client (this is the response for a WSS process) and object that looks like this:

 

{ rows: [ { row1 }, { row2 }, { row3 }... ] }

Can this be achieved using the map shape? The closest I have gotten this to working is a response on the client that isn't valid JSON, but rather:

 

{ rows: [ { row1 } ] }{ rows: [ { row2 } ] }{ rows: [ { row3 } ] }...

Outcomes