In MariaDB, JSON_EXISTS()
is a built-in function that allows you to check whether a value exists at a specified path in the JSON document.
It accepts the JSON document as an argument, and returns 1
if the path is found, and 0
if it’s not.
The MariaDB documentation states that the function “determines whether a specified JSON value exists in the given data”. However, the function doesn’t actually appear to check for a given value. It’s probably more accurate to say that it determines whether a specified path exists, or that a value exists at the specified path.
For checking that the actual value exists, you can use the JSON_CONTAINS()
function.
Continue reading →