Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DocumentDB REST API: x-ms-documentdb-partitionkey is invalid

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?

like image 551
Aiden Thompson Avatar asked Nov 04 '16 13:11

Aiden Thompson


1 Answers

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

x-ms-documentdb-partitionkey: [ "abc" ]
like image 143
Aravind Krishna R. Avatar answered Oct 02 '22 00:10

Aravind Krishna R.