How to convert the JSON array into an array of boolean?

value::boolean[] does not work. how to do?
with test as
(
 SELECT key, value FROM jsonb_each('{"659": [false, false, false], "596": [true, true, true]}'::jsonb)
)
select key::integer, value::boolean[]
from test
June 10th 19 at 15:49
1 answer
June 10th 19 at 15:51
Solution
SELECT key, array_agg(val)
FROM (
 SELECT key::integer, jsonb_array_elements_text(value)::boolean AS val
 FROM jsonb_each('{"659": [false, false, false], "596": [true, true, true]}'::jsonb)
) AS t
GROUP BY key
gratitude, admiration, love... thank you! - Jordane_Kulas commented on June 10th 19 at 15:54

Find more questions by tags PostgreSQLSQL