From decea08e3409873e518b4336fef42537ea18a61d Mon Sep 17 00:00:00 2001 From: Henrik Wallstrom Date: Tue, 6 Apr 2010 14:57:57 +0200 Subject: [PATCH] Check id coument exists based on id and revision --- src/CouchDatabase.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/CouchDatabase.cs b/src/CouchDatabase.cs index 63b7f74..0492dc3 100644 --- a/src/CouchDatabase.cs +++ b/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 {{"Rev", revision}}).Head().Send(); + return true; + } + catch (WebException) + { + return false; + } + } + public bool HasDocument(string documentId) { try