incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Hendricks <mich...@ndrix.org>
Subject Re: deleting a deleted document
Date Fri, 11 Jul 2008 20:02:00 GMT
On Fri, Jul 11, 2008 at 02:44:07PM -0400, Damien Katz wrote:
> There is actually a use case for re-deleting documents.
>
> CouchDB deletions replicate around, just like regular documents. However, I 
> realized i's often not be enough to record that the document was deleted, 
> you might also want there to be meta information stored in the deletion 
> record, like who deleted it, and when.

Very interesting.  Perhaps that explains why I was able to create a
document that started its life deleted.  For instance invoking
_bulk_docs with

    { "docs":[{ "id":"12345", "_deleted":true }] }

> One thing I don't understand about your request though, I'm not sure how 
> you'd delete documents without actually knowing they where already deleted. 
> Since it is required to have the rev to delete, wouldn't you also have 
> loaded the document information to get the rev?

Excellent point.  The test cases I had written in Javascript and Perl
both retained the rev from the previous delete and therefore could
delete without conflict.  When I made another test using fork() to more
closely model what I'm working towards, the rev in the child (which
deleted the document first) and the rev in the parent (which is trying
to delete it second) don't match which causes conflict.

Thank you.

-- 
Michael

Mime
View raw message