Product Solutions Support
Try MemSQL

JSON_LENGTH

Computes the length of a JSON map or array.

JSON_LENGTH(json)

Arguments

Return Type

Examples

mysql> select json_length('true');
+---------------------+
| json_length('true') |
+---------------------+
|                NULL |
+---------------------+

mysql> select json_length('[1,2,3]');
+------------------------+
| json_length('[1,2,3]') |
+------------------------+
|                      3 |
+------------------------+
Info

A JSON or Javascript null value is distinct from SQL NULL.

Was this article useful?