FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
5 snippets foundClear filters
Check JSONB containment
Test whether an object contains a key-value pair.
jsonb✓ Tested
Collect ordered values into an array
Build a sorted array from query rows.
array_agg✓ Tested
Expand an array into rows
Use WITH ORDINALITY to retain original element order.
unnest✓ Tested
Read a JSONB field as text
Extract a nested value from a JSON document.
jsonb✓ Tested
Replace a nested JSONB value
Change one path with jsonb_set.
jsonb_set✓ Tested