I\'m trying to read a single document from DocumentDB by using the document ID. The collection has four fields, author
being the partition key.
{
It's an oversight in the documentation for the node.js client, but you have to add an options.partitionKey
property to the optional second parameter in your readDocument(link, options, callback)
call.
It's also an oversight in the docs but I think partitionKey needs to be an array with a single element (e.g. {options: {partitionKey: ["myKey"]}}
[UPDATE: I'm told that it will now work with a single partition key value but I haven't confirmed it myself.]
Alternatively, you can set options.enableCrossPartitionQuery
property to true
but that is less efficient.