Skip to content

Commit

Permalink
Check id coument exists based on id and revision
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrik Wallstrom committed Apr 6, 2010
1 parent 1e0e519 commit decea08
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/CouchDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit decea08

Please sign in to comment.