You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by King Huang <kc...@ucalgary.ca> on 2010/06/15 18:07:37 UTC

Getting Deleted Document

Is there a way to get access to a deleted document, or be notified about a document about to be deleted?

I have a script monitoring db changes view the _changes API, in order to react to document changes. However, for DELETEs, there doesn't seem to be a way to get access to the just deleted document so that I can get more information about the document that was deleted. GETting the document with ?revs=true to try to find the previous revision returns a 404 because the document's deleted. 

I've thought about using the document update validation and update handler methods to try to maybe catch DELETE methods, set a flag on the document, and then getting the document in my script and doing an "actual" DELETE. But, I don't see a way to do that with those functions. Is something like that possible?

I've also tried using include_docs=True in the _changes feed, but that just returns the final stub document for DELETEs.

Thanks,

King Chung Huang
Technology Solutions Analyst
Information Technologies
University of Calgary