Among the many MySQLÂ aggregate functions is one called JSON_ARRAYAGG()
. This function enables you to aggregate a result set as a single JSON array. Each row of the result set ends up as a single element in the array.
The order of the elements in the array is undefined.