Closed StickNitro closed 5 years ago
You need to provide the partition key value not the partition key definition when you delete. Your delete request should look like this, assuming the id is your partition key.
var deleted = await this._cosmonautClient.DeleteDocumentAsync(this._databaseName, collectionName, message.Id, new RequestOptions { PartitionKey = new PartitionKey(message.Id) });
I have a generic service using the
CosmonautClient
and using shared collections, this is a single service with a single POST method that I then use to post Queries or Commands to the endpoint and return the relevant entity.Everything in this setup works with the exception of the
DeleteDocumentAsync
method call which returnsnull
and the subsequent query agains the same collection yields results containing the "deleted" documentCan you advise if this is a problem please?
NOTE: I have also tried getting the
SelfLink
and using theDocumentClient
to delete the document this way but I get an exception stating the resource does not exist