我需要在couchbase中的json对象中添加一个键。我该如何编写查询?

问题描述 投票:0回答:1

我需要编写n1ql来更新couchbase中存在的json对象。下面是我的json对象名称为“Activity”,我需要在“attribute_val”之后添加“parent”:“demog”:“1098”。我该怎么做

提前致谢

"cus_activity": {
        "attribute_nm": "cO",
        "attribute_val": "1098",
        "activity_type": "hbg",
        "entity_identifier": "12903"
      } 
json n1ql
1个回答
0
投票
UPDATE cus_activity AS ca 
SET ca.parent = "demog"
WHERE ......;

JSON是对象中的键值对属性位置,没有任何意义。

© www.soinside.com 2019 - 2024. All rights reserved.