Bug #84167 | Managing deeply nested JSON documents with JSON_SET, JSON_MERGE | ||
---|---|---|---|
Submitted: | 12 Dec 2016 16:33 | Modified: | 21 Mar 2018 11:17 |
Reporter: | Geza Turi | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: JSON | Severity: | S4 (Feature request) |
Version: | mysql Ver 14.14 Distrib 5.7.16 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | json_merge, json_set |
[12 Dec 2016 16:33]
Geza Turi
[14 Dec 2016 9:08]
Bazard Shoxer
Fully agree with Geza Turi. This is a real pain when using the JSON column type for unknown data-structures / data-structures which can vary for every single record. The workaround I posted in stackoverflow works, also the one from Fyrye, but these aren't the most elegant solutions. It would by nice if MySQL came up with a solution for this in a more constructive way.
[21 Mar 2018 11:17]
Knut Anders Hatlen
Thanks for the enhancement request. This use case should be covered now by the JSON_MERGE_PATCH function that was added in WL#9692 - https://dev.mysql.com/worklog/task/?id=9692. UPDATE sometable SET some_json_column = JSON_MERGE_PATCH(some_json_column, '{"some_none_existing_path":{"subpath":"somevalue"}}') WHERE ...