Skip to content
Advertisement

How to get specific objects value from JSONB array in PostgreSQL?

I have a column named people and it’s type is JSONB.

Here is the sample data (1 row):

I would like to get list of streets that have valid? true value for all rows.

Result:

I’m able to list of arrays could not filter values tho.

Advertisement

Answer

You need to unnest the array and then filter on the result:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement