From 9672e714371e7fdf12b0c58fe0b355e2a8d1ebd2 Mon Sep 17 00:00:00 2001 From: Florents Tselai Date: Tue, 17 Sep 2024 23:38:01 +0300 Subject: [PATCH v2 2/3] Add docs for strip_in_arrays argument --- doc/src/sgml/func.sgml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 47370e581ae..129103323c5 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -17179,25 +17179,31 @@ ERROR: value too long for type character(2) json_strip_nulls - json_strip_nulls ( json ) + json_strip_nulls ( target jsonb, ,strip_in_arrays boolean ) json jsonb_strip_nulls - jsonb_strip_nulls ( jsonb ) + jsonb_strip_nulls ( target jsonb, ,strip_in_arrays boolean ) jsonb Deletes all object fields that have null values from the given JSON value, recursively. Null values that are not object fields are untouched. + If strip_in_arrays is true (default is false), null array elements are also stripped. json_strip_nulls('[{"f1":1, "f2":null}, 2, null, 3]') [{"f1":1},2,null,3] - + + + jsonb_strip_nulls('[1,2,null,3,4]', true); + [1,2,3,4] + + -- 2.48.1