我正在尝试使用PHP(缺少官方API包装器)通过REST将JSON文档插入DocumentDB.现在,似乎分区键已成为DocumentDB中任何集合的必需项,但我找不到记录的REST API.
我得到以下错误作为回报:
PartitionKey extracted from document doesn't match the one specified in the header
Run Code Online (Sandbox Code Playgroud)
我试图插入的JSON文档如下所示:
{ id:"1", ... "domain":"domain.com" }
Run Code Online (Sandbox Code Playgroud)
在Azure中,我使用以下分区键定义了集合:
/domain
Run Code Online (Sandbox Code Playgroud)
在发送REST请求时,我发送以下标题:
x-ms-documentdb-partitionkey: [ "domain" ]
Run Code Online (Sandbox Code Playgroud)
我在这里错过了什么?