Tutti gli operatori in PostgreSQL utilizzano la procedura sottostante:
> SELECT oprname, oprcode FROM pg_operator WHERE oprname LIKE '%?%'
oprname | oprcode
--------------------------
? | jsonb_exists
?| | jsonb_exists_any
?& | jsonb_exists_all
...
Quindi puoi riscrivere la tua query usando jsonb_exists(jsonb, text)
così:
SELECT t.id
FROM task AS t
WHERE jsonb_exists(t.worker_ids, :workerId)
ORDER BY t.created_at