Reputation: 125
I am trying to update my mysql table and insert json
data to my mysql
table's json-datatype
column using JSON_INSERT
. Here is the structure of my column.
{
"Data":
[{
"Devce": "ios",
"Status": 1
}]
}
This is the query I am using to insert
more data to this field.
UPDATE table SET `Value` = JSON_INSERT
(`Value`,'$.Data','{\"Device\":\"ios\",\"Status\":1}') WHERE Meta = 'REQUEST_APP'
This is supposed to update the field to this:
{
"Data":
[{
"Devce": "ios",
"Status": 1
},
{
"Devce": "ios",
"Status": 1
}
]
}
But instead it the result is:
0 rows affected. (Query took 0.0241 seconds.)
Any help regarding this would be appreciated.
Upvotes: 6
Views: 1990