Permalink
Browse files

Check id coument exists based on id and revision

  • Loading branch information...
1 parent 1e0e519 commit decea08e3409873e518b4336fef42537ea18a61d @whenrik whenrik committed Apr 6, 2010
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/CouchDatabase.cs
View
13 src/CouchDatabase.cs
@@ -798,6 +798,19 @@ public bool HasDocumentChanged(string documentId, string rev)
return Request(documentId).Head().Send().Etag() != rev;
}
+ public bool HasDocument(string documentId, string revision)
+ {
+ try
+ {
+ Request(documentId).QueryOptions(new Dictionary<string, string> {{"Rev", revision}}).Head().Send();
+ return true;
+ }
+ catch (WebException)
+ {
+ return false;
+ }
+ }
+
public bool HasDocument(string documentId)
{
try

0 comments on commit decea08

Please sign in to comment.