In the MariaDB documentation it says that JSON_SET inserts or updates information, while JSON_INSERT just inserts, and JSON_REPLACE only substitutes.
I am using the code below, and I need the information to be inserted, if it does not exist, or updated, if it already exists.
The problem is that it is only updating, when it already exists, and it does not insert, if it does not exist.
UPDATE myTable SET config = JSON_SET( config, '$.person.name', 'zeca', '$.person.details.age', '87' ) WHERE id = 127
If "details" already exist in the "config" field of myTable, "age" will be registered. If "details" still do not exist, I want to register details.age, but it is not registering.