Search JSONB embedded array using SequelizeJs
query.$or.push(sequelize.literal(`to_json(array(select jsonb_array_elements("${hook.service.options.name}"."metadata"->'referenceIds') ->> 'id'))::jsonb ?| array['${query.$search}']`));
query.$or.push(sequelize.literal(`to_json(array(select jsonb_array_elements("${hook.service.options.name}"."metadata"->'referenceIds') ->> 'id'))::jsonb ?| array['${query.$search}']`));