Path Operators: -> ->> @>
Navigate JSONB documents with ->, ->>, #>>, and check containment with @> and the jsonb_path_query family.
Three Operator Families
JSONB path operators come in three flavours:
->and->>— extract by key or index#>and#>>— extract by path@>and?— test containment / key existence
-> Returns JSONB
Extract a value, keep it as JSONB:
SELECT data->'user_id' FROM events;
-- returns JSONB like 42
SELECT data->0 FROM events;
-- first element of a JSONB arrayAll lessons in this course
- JSONB vs JSON: When to Use Each
- Path Operators: -> ->> @>
- Indexing JSONB with GIN
- Modelling: When JSONB Beats Normalisation