Syntax:
JSON_ARRAYAGG(col_or_expr)

Aggregates a result set as a single JSON array whose elements consist
of the rows. The order of elements in this array is undefined. The
function acts on a column or an expression that evaluates to a single
value. Returns NULL if the result contains no rows, or in the event of
an error.

URL: https://dev.mysql.com/doc/refman/5.7/en/aggregate-functions.html

