DeleteDocumentAsync
and ReadDocumentAsync
don't work for me when I have a partitioned collection. I used the RequestOptions
:
await client.DeleteDocumentAsync(document.SelfLink, new RequestOptions {
PartitionKey = new PartitionKey("mykey")
}).ConfigureAwait(false); // This works.
var uri = UriFactory.CreateDocumentUri("db", "coll", "id1");
await client.DeleteDocumentAsync(uri, new RequestOptions {
PartitionKey = new PartitionKey("mykey")
}).ConfigureAwait(false); // This throws
Partition key provided either doesn't correspond to definition in the collection or doesn't match partition key field values specified in the document.
Any ideas?
myKey
innew PartitionKey("mykey")
the name of the PartitionKey attribute (e.g.lastName
) or the value of the attribute (e.g.Smith
)? – Gaurav Mantri