我想更新存储在 Couchbase 中的以下文档中的特定字段:
"name": "Douglas Reynholm",
"email": "douglas@reynholmindustries.com",
"addresses": {
"billing": {
"line1": "123 Any Street",
"line2": "Anytown ",
"country": "United Kingdom"
},
"delivery": {
"line1": "123 Any Street",
"line2": "Anytown ",
"country": "United Kingdom"
}
},
"purchases": {
"complete": [
339, 976, 442, 666
],
"abandoned": [
157, 42, 999
]
}
}
如何使用 Java SDK 编写通用查询来处理子文档更新的所有可能组合?例如,一个用户想要更新“addresses.delivery.country”字段,而另一个用户想要更新“name”字段。
对每个可能的子文档更新情况进行正确的自定义查询是很困难的。对吗?