JSON_SEARCH
JSON_SEARCH() finds the path of a value within a JSON document. Returns the path or NULL if not found.
JSON_SEARCH() finds the path of a value within a JSON document. Returns the path or NULL if not found.
SELECT JSON_SEARCH(
'{"colors": ["red", "blue", "green"]}',
'one', -- "one" = first match, "all" = all matches
'blue'
);
-- Returns: "$.colors[1]"
JSON_SEARCH supports LIKE-style wildcards: JSON_SEARCH(doc, "one", "%ue").