JSON_LENGTH(json_doc[, path])

Returns the length of JSON document, or, if a path argument is given,
the length of the value within the document identified by the path.
Returns NULL if any argument is NULL or the path argument does not
identify a value in the document. An error occurs if the json_doc
argument is not a valid JSON document or the path argument is not a
valid path expression or contains a * or ** wildcard.

The length of a document is determined as follows:

o The length of a scalar is 1.

o The length of an array is the number of array elements.

o The length of an object is the number of object members.

o The length does not count the length of nested arrays or objects.

URL: http://dev.mysql.com/doc/refman/5.7/en/json-attribute-functions.html

