I have next resultset from Postgres data base : actually I never work with postgres json and I naven't found any same examples
id | another_id
--------------
1 | 10
1 | 11
3 | 20
3 | 21
3 | 22
and I need to transform it as a json string:
{"id":1 , "another_id" : {[10,11]}}
{"id":3 , "another_id" : {[20,21,22]}