MySQL since version 5.7 has some fundamental JSON support, however I've been looking through the documentation but couldn't find anything JSON aggregatable functions.
Are there any JSON aggregate functions in MySQL 5.7+?
For example if you have query:
SELECT id, GROUP_CONCAT(name) FROM given_names GROUP BY id
You'd get a result like:
id | name
1 | Jon,Smith
2 | Hubert,Blaine,Wolfeschlegelsteinhausenbergerdorff
....
Is there an equivalent way to get a JSON array with?
My concern is with properly escaping strings because when you use GROUP_CONCAT if the string contains the separator it is near impossible to differentiate the parts afterwards.
idbut there could be more).