PostgreSQL jsonb type support for the PgWire compatibility layer.
Stores jsonb values as Clojure data structures (maps, vectors, strings, numbers, booleans, nil) serialized to/from JSON strings via jsonista.
Implements PostgreSQL jsonb operators and functions as pure Clojure functions that can be used as Datalog predicates or post-processing.
PostgreSQL jsonb type support for the PgWire compatibility layer. Stores jsonb values as Clojure data structures (maps, vectors, strings, numbers, booleans, nil) serialized to/from JSON strings via jsonista. Implements PostgreSQL jsonb operators and functions as pure Clojure functions that can be used as Datalog predicates or post-processing.
(format-jsonb-value v)Format a jsonb Clojure value for PgWire text protocol transport. Returns a JSON string.
Format a jsonb Clojure value for PgWire text protocol transport. Returns a JSON string.
(jsonb-array-elements v)PostgreSQL jsonb_array_elements(jsonb): expand array to element rows.
PostgreSQL jsonb_array_elements(jsonb): expand array to element rows.
(jsonb-array-elements-text v)PostgreSQL jsonb_array_elements_text(jsonb): expand array to text rows.
PostgreSQL jsonb_array_elements_text(jsonb): expand array to text rows.
(jsonb-array-length v)PostgreSQL jsonb_array_length(jsonb): return array length.
PostgreSQL jsonb_array_length(jsonb): return array length.
(jsonb-build-array & args)PostgreSQL jsonb_build_array(v1, v2, ...): build jsonb array.
PostgreSQL jsonb_build_array(v1, v2, ...): build jsonb array.
(jsonb-build-object & args)PostgreSQL jsonb_build_object(k1, v1, k2, v2, ...): build jsonb from pairs.
PostgreSQL jsonb_build_object(k1, v1, k2, v2, ...): build jsonb from pairs.
(jsonb-concat left right)PostgreSQL || operator: concatenate/merge two jsonb values.
PostgreSQL || operator: concatenate/merge two jsonb values.
(jsonb-contained? left right)PostgreSQL <@ operator: is left contained in right?
PostgreSQL <@ operator: is left contained in right?
(jsonb-contains? left right)PostgreSQL @> operator: does left contain right?
PostgreSQL @> operator: does left contain right?
(jsonb-delete-idx v idx)PostgreSQL - operator (int4): remove element by index from array.
PostgreSQL - operator (int4): remove element by index from array.
(jsonb-delete-key v key)PostgreSQL - operator (text): remove key from jsonb object.
PostgreSQL - operator (text): remove key from jsonb object.
(jsonb-delete-keys v keys)PostgreSQL - operator (text[]): remove multiple keys.
PostgreSQL - operator (text[]): remove multiple keys.
(jsonb-delete-path v path)PostgreSQL #- operator: remove element at path.
PostgreSQL #- operator: remove element at path.
(jsonb-each v)PostgreSQL jsonb_each(jsonb): expand object to (key, value) rows. Returns sequence of [key value] pairs where value is jsonb.
PostgreSQL jsonb_each(jsonb): expand object to (key, value) rows. Returns sequence of [key value] pairs where value is jsonb.
(jsonb-each-text v)PostgreSQL jsonb_each_text(jsonb): expand object to (key, value) rows. Returns sequence of [key text-value] pairs.
PostgreSQL jsonb_each_text(jsonb): expand object to (key, value) rows. Returns sequence of [key text-value] pairs.
(jsonb-exists-all? v keys)PostgreSQL ?& operator: do all keys exist?
PostgreSQL ?& operator: do all keys exist?
(jsonb-exists-any? v keys)PostgreSQL ?| operator: does any of the keys exist?
PostgreSQL ?| operator: does any of the keys exist?
(jsonb-exists? v key)PostgreSQL ? operator: does key exist in jsonb object?
PostgreSQL ? operator: does key exist in jsonb object?
(jsonb-get v key-or-idx)PostgreSQL -> operator: get jsonb field by key (text) or element by index (int). Returns jsonb (Clojure data structure). Returns :null sentinel unchanged (NULL propagation for get-else).
PostgreSQL -> operator: get jsonb field by key (text) or element by index (int). Returns jsonb (Clojure data structure). Returns :__null__ sentinel unchanged (NULL propagation for get-else).
(jsonb-get-path v path)PostgreSQL #> operator: extract jsonb at path. Path is a sequence of text keys.
PostgreSQL #> operator: extract jsonb at path. Path is a sequence of text keys.
(jsonb-get-path-text v path)PostgreSQL #>> operator: extract text at path.
Returns :__null__ sentinel when the path doesn't exist — returning nil
would make Datahike's function-binding clause filter the row.
PostgreSQL #>> operator: extract text at path. Returns `:__null__` sentinel when the path doesn't exist — returning nil would make Datahike's function-binding clause filter the row.
(jsonb-get-text v key-or-idx)PostgreSQL ->> operator: get field/element as text string.
Returns a string or :__null__ sentinel. Never returns nil — Datahike's
function-binding clauses filter the row when the binding returns nil, but
foo->>missing_key should produce SQL NULL while keeping the row.
PostgreSQL ->> operator: get field/element as text string. Returns a string or `:__null__` sentinel. Never returns nil — Datahike's function-binding clauses filter the row when the binding returns nil, but `foo->>missing_key` should produce SQL NULL while keeping the row.
(jsonb-insert target path new-value)(jsonb-insert target path new-value insert-after?)PostgreSQL jsonb_insert(target, path, new_value, insert_after?): Insert value at path position in jsonb array.
PostgreSQL jsonb_insert(target, path, new_value, insert_after?): Insert value at path position in jsonb array.
(jsonb-object-agg-step acc k v)Accumulator step for jsonb_object_agg(key, value).
Accumulator step for jsonb_object_agg(key, value).
(jsonb-object-keys v)PostgreSQL jsonb_object_keys(jsonb): return keys of object. Returns a sequence (set-returning in SQL).
PostgreSQL jsonb_object_keys(jsonb): return keys of object. Returns a sequence (set-returning in SQL).
(jsonb-pretty v)PostgreSQL jsonb_pretty(jsonb): pretty-print jsonb.
PostgreSQL jsonb_pretty(jsonb): pretty-print jsonb.
(jsonb-set target path new-value)(jsonb-set target path new-value create-missing?)PostgreSQL jsonb_set(target, path, new_value, create_missing?): Set value at path in jsonb.
PostgreSQL jsonb_set(target, path, new_value, create_missing?): Set value at path in jsonb.
(jsonb-strip-nulls v)PostgreSQL jsonb_strip_nulls(jsonb): recursively remove null-valued keys.
PostgreSQL jsonb_strip_nulls(jsonb): recursively remove null-valued keys.
(jsonb-typeof v)PostgreSQL jsonb_typeof(jsonb): return type name as string.
PostgreSQL jsonb_typeof(jsonb): return type name as string.
(parse-jsonb v)Parse a JSON string to a Clojure data structure. Returns nil for nil input, passes through non-strings.
Parse a JSON string to a Clojure data structure. Returns nil for nil input, passes through non-strings.
(serialize-jsonb v)Serialize a Clojure data structure to a JSON string. Returns nil for nil input.
Serialize a Clojure data structure to a JSON string. Returns nil for nil input.
(to-jsonb v)PostgreSQL to_jsonb(any): convert any value to jsonb.
PostgreSQL to_jsonb(any): convert any value to jsonb.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |