Açıklaması şöyle
?| - Checks if any of the strings in the text array exist as top-level keys or array elements. So generally if we have JSON property that contains an array then you can check if it contains at least of elements that you are searching by.
Aynı şeyi SQL ile şöyle yaparız. jsonb_any_array_strings_exist kullanılır
CREATE OR REPLACE FUNCTION jsonb_any_array_strings_exist(jsonb, text[]) RETURNS boolean AS $$ SELECT $1 ?| $2; $$ LANGUAGE SQL; SELECTitem0_.id as id1_0_,item0_.jsonb_content as jsonb_co2_0_FROMitem item0_WHEREjsonb_any_array_strings_exist(jsonb_extract_path(item0_.jsonb_content,?), array[?,?])=true
Hiç yorum yok:
Yorum Gönder