I have a JSON field with a simple numeric array
[46,70,34]
How can I filter query selecting only those rows where present let's say '70' in a JSON field? Something similar to JSON_CONTAINS in MySQL.
I have already tried
SELECT id, name, IN(tags, '70') AS c FROM index WHERE c = 1;
and
SELECT id, name, ALL(var='70' FOR var IN tags) as c FROM index WHERE c=1;
But it doesn't work.
Actully think...
should just work. JSON arrays, end up working 'like' a MVA.
Otherwise, you would want
ANY()(notALL()), because only one of the values in the JSON array would be 70, not all of them (46 wouldn't match for example!)(finally as a numeric value, shouldn't be quoted!)