PostgreSQL JSONB
-
Database
PostgreSQL JSONB Tutorial: Store, Query and Index JSON the Right Way
Use the jsonb type (not json) for JSON in PostgreSQL. Read values with -> (returns JSON) and ->> (returns text), filter with the containment operator @> and key-exists operator ?, update parts with jsonb_set and the || merge operator, and speed queries up with a GIN index for containment or an expression index on one frequently filtered key.
