Reputation: 3663
I have a Postgres query that starts like this.
SELECT json_build_object(
'type', 'Feature',
'properties', pop_density,
)
That returns something like {"type":"Feature", "properties":10000}
. I want it to return {"type":"Feature", "properties": {pop_density: 10000}}
.
How do I change my query to reflect that?
Upvotes: 0
Views: 278
Reputation: 1056
call json_build_object
to make 'properties' object
select json_build_object('type', 'type_val', 'properties',
json_build_object('pop_density', 'pop_val'));
Upvotes: 1