【发布时间】:2015-12-12 18:50:31
【问题描述】:
我在 Azure DocumentDB 中有一个集合,其中的文档使用名为 clusterName 的 JSON 属性将文档聚集成 3 个集合。 3 组文档的模板有点像这样:
{ "clusterName": "客户信息", "id": "CustInfo1001", “客户名称”:“XXXX” },
{ "clusterName": "区域信息", "id": "ZoneInfo5005", “区域名称”:“YYYY” },
{ "clusterName": "CustomerZoneAssociation", "id": "CustZoneAss9009", "custId": "CustInfo1001", “zoneId”:“ZoneInfo5005” }
您可以看到 CustomerZoneAssociation 的文档将 CustomerInformation 和 ZoneInformation 的文档与它们的 Id 链接起来。我需要帮助查询来自 CustomerInformation 和 ZoneInformation 集群的信息,这要借助它们在 CustomerZoneAssociation 集群中关联的 Id 。我期待的查询结果是:
{ "clusterName": "CustomerZoneAssociation", "id": "CustZoneAss9009", "custId": "CustInfo1001", "custName": "XXXX", "zoneId": "ZoneInfo5005", “区域名称”:“YYYY” }
请提出一个仅需 1 次即可访问 DocumentDB 的解决方案
【问题讨论】:
标签: azure-cosmosdb