PostgreSQL, finding elements by value in numeric JSON arrays
You're using the wrong operator, you want @&gt; (added in 9.4). ?&amp; only operates over JSON objects.

SELECT
  j,
  j @&gt; '"dog"'::jsonb AS hasDog,
  j @&gt; '["dog","waffle"]' AS hasDogAndWaffle,
  j @&gt; '5'   AS has5,
  j @&gt; '42'  AS has42
FROM ( VALUES
  ('[5,2,3]'::jsonb),
  ('["dog","cat","elephant","waffle"]'::jsonb)
)
  AS t(j);

                  j                   | hasdog | hasdogandwaffle | has5 | has42 
--------------------------------------+--------+-----------------+------+-------
 [5, 2, 3]                            | f      | f               | t    | f
 ["dog", "cat", "elephant", "waffle"] | t      | t               | f    | f
(2 rows)


If all you're storing is numbers, you should consider using intarray and not jsonb. It should be a lot faster.