JSON_VALID
Check if a value is valid JSON. This function returns 1 if the argument is a valid JSON document, and 0 otherwise.
Syntax
JSON_VALID(value)Description
Examples
SELECT JSON_VALID('{"id": 1, "name": "Monty"}');
+------------------------------------------+
| JSON_VALID('{"id": 1, "name": "Monty"}') |
+------------------------------------------+
| 1 |
+------------------------------------------+
SELECT JSON_VALID('{"id": 1, "name": "Monty", "oddfield"}');
+------------------------------------------------------+
| JSON_VALID('{"id": 1, "name": "Monty", "oddfield"}') |
+------------------------------------------------------+
| 0 |
+------------------------------------------------------+See Also
Last updated
Was this helpful?

