1 | initial version |
To retrieve data from a nested JSONB object in Supabase:
Use the ->
operator to access the value of a specific key inside the nested JSONB object.
SELECT data -> 'person' -> 'name' AS person_name
FROM table_name;
Use the ->>
operator to access the value of a specific key inside the nested JSONB object and convert it to a text value.
SELECT data ->> 'person' ->> 'name' AS person_name
FROM table_name;
Use the #>
operator to access the value of a specific key path inside the nested JSONB object.
SELECT data #> '{person, address, city}' AS person_city
FROM table_name;
Use the #>>
operator to access the value of a specific key path inside the nested JSONB object and convert it to a text value.
SELECT data #>> '{person, address, city}' AS person_city
FROM table_name;