在发布数据的同时,我使用了escapeCSV来处理额外的逗号,但数据有一些额外的/“现在我想通过使用N1QL来更新内容,但是我被卡住了
"School": [
{
"address": "\"257 Shyam Nagar, Indore\"",
"name": "National Convent"
}
Required:-
"School": [
{
"address": "257 Shyam Nagar, Indore",
"name": "National Convent"
}
使用REPLACE()函数
UPDATE default d
SET p.address = REPLACE(p.address, "\"","") FOR p IN d.School END
WHERE ...;
您需要在导入之前删除它们,N1QL需要有效的JSON。此外,您还可以使用单引号:
INSERT INTO `test` ( KEY, VALUE )
VALUES
(
'mykey2',
{
'type': '"toy',
"attributes": {
'material': 'metal"',
'color': 'red""',
'weight': '200gr"',
'height': '5cm',
'width': '15cm'
}
}
)