JSON_OVERLAPS
JSON_OVERLAPS() (MySQL 8.0.17+) returns true if two JSON documents share any elements. JSON_CONTAINS_PATH() checks whether a path exists.
JSON_OVERLAPS() (MySQL 8.0.17+) returns true if two JSON documents share any elements. JSON_CONTAINS_PATH() checks whether a path exists.
-- Check if any tag matches
SELECT * FROM articles
WHERE JSON_OVERLAPS(tags, '["php", "mysql"]');
-- Check if a path exists
SELECT JSON_CONTAINS_PATH(
'{"a": {"b": 1}}',
'one',
'$.a.b'
); -- 1 (true)
JSON_OVERLAPS is great for tag/category intersection queries.