I am trying to get the source and target where source is 270 and the column is jsonb and values like
[{"source": 270, "target": 285},
{"source": 427, "target": 285},
{"source": 285, "target": 285}]
The expected output is {"source": 270, "target": 285}
2
Answers
It is working If I use the following Query. Here links is the column name.
select links from (select jsonb_array_elements(links) as links from supply_chain_graph) as foo where links->>'source'='270'
You can use a JSON path query: