Skip to content
PostgreSQL

JSONB API Reference

PostgreSQL JSONB functions and operators for storing, querying and transforming JSON documents.

By EZ4Code Team

JSONB

Functions and operators for the binary JSON type.

jsonb_set(target jsonb, path text[], new_value jsonb, create_missing bool = true) -> jsonb

Returns target with the field at the given path set to new_value, optionally creating it.

Returns: jsonb

jsonb_build_object(key text, value any, ...) -> jsonb

Builds a JSON object from alternating key/value arguments.

Returns: jsonb

jsonb @> jsonb -> bool

Returns true if the left JSON value contains the right value (top-level containment).

Returns: bool

jsonb ? text -> bool

Returns true if the JSON object has the given top-level key, or array contains the string.

Returns: bool

jsonb_agg(expr ORDER BY ...) -> jsonb

Aggregates values into a JSON array, optionally ordered.

Returns: jsonb

More PostgreSQL API References