postgreSQL operator returns values out of JSON columns
Selecting 1 column:
Selecting 2 columns:
-> vs ->>
The -> operator returns the original JSON type (which might be an object), whereas ->> returns text.
Return NESTED objects
You can use the -> to return a nested object and thus chain the operators:
Select rows based on a value inside your JSON:
Notice WHERE uses -> so we must compare to JSON '"Dharma Bums"'
Or we could use ->> and compare to 'Dharma Bums'