json_object_agg ( key "any", value "any" ORDER BY input_sort_columns ) → jsonCollects all the key/value pairs into a JSON object. Key arguments are coerced to text; value arguments are converted as per
to_json or to_jsonb. Values can be null, but keys cannot.