When doing:
mysql -u case -p < MyQuery.sql
with the query being:
SELECT JSON_ARRAYAGG(JSON_OBJECT(\'field1\', field1, ...))