couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Hendricks <>
Subject Re: deleting a deleted document
Date Fri, 11 Jul 2008 15:20:41 GMT
On Thu, Jul 10, 2008 at 04:56:27PM -0700, Troy Kruthoff wrote:
> I would think it would be expected behavior, as the end result is the same 
> regardless if the document existed.  Maybe some edge cases would need to 
> know if the document was already deleted. I could be skewed because all of 
> our current apps use a RDMS as a backend where deleting a non-existent 
> record is no-harm-no-foul.

In my experience, trying to delete something that has already been
deleted is a sign of a logic error in my application.  Most database
interface modules that I've worked with generate exceptions in such
cases (even if the underlying database doesn't) as a way to help the
programmer find his mistakes. If I knew that something was deleted, I
probably wouldn't be trying to delete it again.

My other concern is that the CouchDB REST API doesn't accept double
deletions.  It generates an error.  If CouchDB is going to give an error
in one place, I think it should be consistent and do it elsewhere too.

I can see some value in making this a configurable behavior if others
don't want an error under this circumstance.  Of course, I probably
won't send a patch for that since it's not my itch ;-)


View raw message