Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DocumentDB: Delete a document by ID

I'm using a new database from Microsoft called DocumentDB. Now I want to delete a document by ID, but I cannot figure out, how to do this. Delete operation in DocumentDB requires self-links and they are different from my own ids.

using (var client = new DocumentClient(EndPoint, AuthKey))
{
    await client.DeleteDocumentAsync("**self-link here**");
}

I can execute an additional query to find the self-link and then pass it, but this will require two operations instead one and that is what I'd like to avoid. Is there a better way to remove an entry by ID without using queries or stored procedures?

like image 521
user1224129 Avatar asked Aug 22 '14 17:08

user1224129


1 Answers

* UPDATE * This feature has now been implemented

* ORIGINAL ANSWER *

Not today, no. You can head to http://feedback.azure.com/forums/263030-documentdb and vote for the feature there.

like image 144
Ryan CrawCour Avatar answered Oct 11 '22 05:10

Ryan CrawCour