添加到JSON数组

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

如何使用N1QL将新元素附加到现有数组中?

[
{
  "address": "127.0.0.1",
  "time": 0
},
{
  "address": "127.0.0.1",
  "time": 0
}
]
couchbase n1ql
1个回答
0
投票

您可以设置更新数据

 ARRAY_APPEND(field, { "adress":"127.0.0.1", "time":null }) 

 where "key you need to use as reference' = "referemce data"
© www.soinside.com 2019 - 2024. All rights reserved.