I am trying to update mysql table and insert jsondata into mysqltable column json-datatypeusing JSON_INSERT. Here is the structure of my column.
{
"Data":
[{
"Devce": "ios",
"Status": 1
}]
}
This is the query that I use for insertadditional data in this field.
UPDATE table SET `Value` = JSON_INSERT
(`Value`,'$.Data','{\"Device\":\"ios\",\"Status\":1}') WHERE Meta = 'REQUEST_APP'
It is supposed to update the field to this:
{
"Data":
[{
"Devce": "ios",
"Status": 1
},
{
"Devce": "ios",
"Status": 1
}
]
}
But instead, the result is:
0 rows affected. (The request took 0.0241 seconds.)
Any help in this regard would be appreciated.
source
share