I am looking to use json_search to get the array path that corresponds to a value.
I have tried and this works:
SET @j = '["3", "2", "1"]';
SELECT json_search(@j, 'one', '2');
returns $[1];
I have tried and this doesn't work: (How do I make this work?)
SET @j = '[3, 2, 1]';
SELECT json_search(@j, 'one', 2);
returns null;
Basically I want to store @j as an integer array instead of a string array for indexing purposes. Is there any way I can change the integer array into a string array for comparison if there is no way for json_search to work with integers?