DocumentDB REST API:x-ms-documentdb-partitionkey无效 [英] DocumentDB REST API: x-ms-documentdb-partitionkey is invalid

查看:78
本文介绍了DocumentDB REST API:x-ms-documentdb-partitionkey无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用REST API从DocumentDB获取文档.我使用的是分区集合,因此需要添加"x-ms-documentdb-partitionkey"标头.如果添加此内容,则会显示分区键abc无效".我在文档中找不到任何期望键为特定格式的地方,但是仅提供期望的字符串值是行不通的.有人知道预期的格式吗?

I am attempted to get a Document from DocumentDB using the REST API. I am using a partitioned Collection and therefore need to add the "x-ms-documentdb-partitionkey" header. If I add this, I get "Partition key abc is invalid". I can't find anywhere in the documentation that expects the key to be in specific format, but simply supplying the expected string value does not work. Does anyone know the expected format?

推荐答案

分区键必须指定为数组(带有单个元素).例如:

Partition key must be specified as an array (with a single element). For example:

x-ms-documentdb-partitionkey: [ "abc" ]

这篇关于DocumentDB REST API:x-ms-documentdb-partitionkey无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆