Açıklaması şöyle
Aynı şeyi SQL ile şöyle yaparız. jsonb_all_array_strings_exist kullanılır?& - Checks if all 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 all elements that you are searching by.
CREATE OR REPLACE FUNCTION jsonb_all_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_ FROM item item0_ WHERE jsonb_all_array_strings_exist(jsonb_extract_path(item0_.jsonb_content,?), array[?,?])=true
Hiç yorum yok:
Yorum Gönder