mysql-避免在json函数中转义双引号

mysql-避免在json函数中转义双引号,mysql,json,Mysql,Json,当我发布 select JSON_REPLACE('{"tbl" : "cnf"}', '$', '{"tbl":"cnf4"}'); 我得到以下信息: +--------------------------------------------------------+ | JSON_REPLACE('{"tbl" : "cnf"}', '$', '{"tbl":"cnf4"}') | +-----------------------------------------------------

当我发布

select JSON_REPLACE('{"tbl" : "cnf"}', '$', '{"tbl":"cnf4"}');
我得到以下信息:

+--------------------------------------------------------+
| JSON_REPLACE('{"tbl" : "cnf"}', '$', '{"tbl":"cnf4"}') |
+--------------------------------------------------------+
| "{\"tbl\":\"cnf4\"}"                                   |
+--------------------------------------------------------+
它以同样的方式存储在我的数据库中,比如说,使用反斜杠。我希望我的数据库中没有反斜杠。我怎样才能做到这一点

我希望得到这样的回复: {“tbl”:“cnf4”}

用JSON包装

select JSON_UNQUOTE(JSON_REPLACE('{"tbl" : "cnf"}', '$', '{"tbl":"cnf4"}'));
+----------------------------------------------------------------------+
| JSON_UNQUOTE(JSON_REPLACE('{"tbl" : "cnf"}', '$', '{"tbl":"cnf4"}')) |
+----------------------------------------------------------------------+
| {"tbl":"cnf4"}                                                       |
+----------------------------------------------------------------------+
1 row in set (0.0005 sec)

那么,您想修复插入还是需要处理select上的反斜杠数据?或者两者都是?谢谢,这正是我想要的。那么这个例子呢,为什么不取消引用新替换json对象的值呢<代码>选择JSON(JSON替换('{“tbl”:“shouldbereplace”}','$.tbl','{“newKey”:“newValue”}')导致
{“tbl”:“{\“newKey\”:\“newValue\”}”}