You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Jens Alfke <je...@couchbase.com> on 2012/09/01 00:35:44 UTC

API to list deleted docs, or deleted revs of a doc?

I’m writing a GUI app to browse the contents of databases, mostly for debugging/troubleshooting purposes. It currently lists all the existing documents, as Futon does, but I’d like to be able to show all the _deleted_ documents too. But I can’t find a query in the API that will do that. Effectively I want something like “GET /db/_all_docs?includedeleteddocstoo=true”. Is there such a thing?

Similarly, my app will show the entire revision tree of a document, including the branches if there are conflicts. It does this by using ?open_revs=all to get the rev IDs of all leaves, and then ?rev=XX&revs_info=true on each of those revisions to get its history, and then merging the histories together. But this doesn’t find already-deleted branches, because they’re not returned by open_revs. Is there a way to get those too?

—Jens

Re: API to list deleted docs, or deleted revs of a doc?

Posted by Paul Davis <pa...@gmail.com>.
On Fri, Aug 31, 2012 at 5:35 PM, Jens Alfke <je...@couchbase.com> wrote:
> I’m writing a GUI app to browse the contents of databases, mostly for debugging/troubleshooting purposes. It currently lists all the existing documents, as Futon does, but I’d like to be able to show all the _deleted_ documents too. But I can’t find a query in the API that will do that. Effectively I want something like “GET /db/_all_docs?includedeleteddocstoo=true”. Is there such a thing?
>

I can't think of any way to iterate these. I know for a fact that
views filter them out with no option to not do that. And I don't
remember anything for _all_docs off the top of my head.

> Similarly, my app will show the entire revision tree of a document, including the branches if there are conflicts. It does this by using ?open_revs=all to get the rev IDs of all leaves, and then ?rev=XX&revs_info=true on each of those revisions to get its history, and then merging the histories together. But this doesn’t find already-deleted branches, because they’re not returned by open_revs. Is there a way to get those too?
>
> —Jens

Pretty sure you have the only viable way. I've been meaning to add an
API that'll return the whole tree just for this exact scenario.

Re: API to list deleted docs, or deleted revs of a doc?

Posted by Robert Keane <ke...@gmail.com>.
The _changes feed does contain 'deleted' docs. I have to filter them out
beforelisting the _changes docs.

rkeane

On Sat, Sep 1, 2012 at 1:42 AM, Nathan Vander Wilt <nate-lists@calftrail.com
> wrote:

>
> On Aug 31, 2012, at 3:35 PM, Jens Alfke wrote:
> > I’m writing a GUI app to browse the contents of databases, mostly for
> debugging/troubleshooting purposes. It currently lists all the existing
> documents, as Futon does, but I’d like to be able to show all the _deleted_
> documents too. But I can’t find a query in the API that will do that.
> Effectively I want something like “GET
> /db/_all_docs?includedeleteddocstoo=true”. Is there such a thing?
>
> The only way I know of to gain an "entry point" into deleted documents
> (unless you know their _ids?) is to filter through the whole _changes feed;
> this was somewhat confirmed by another commenter on Stack Overflow:
> http://stackoverflow.com/a/10422892/179583
>
> hth,
> -nvw

Re: API to list deleted docs, or deleted revs of a doc?

Posted by Paul Davis <pa...@gmail.com>.
Good call.

Should be easy enough to add an include_deleted=true option to
_all_docs as well.

On Sat, Sep 1, 2012 at 12:42 AM, Nathan Vander Wilt
<na...@calftrail.com> wrote:
>
> On Aug 31, 2012, at 3:35 PM, Jens Alfke wrote:
>> I’m writing a GUI app to browse the contents of databases, mostly for debugging/troubleshooting purposes. It currently lists all the existing documents, as Futon does, but I’d like to be able to show all the _deleted_ documents too. But I can’t find a query in the API that will do that. Effectively I want something like “GET /db/_all_docs?includedeleteddocstoo=true”. Is there such a thing?
>
> The only way I know of to gain an "entry point" into deleted documents (unless you know their _ids?) is to filter through the whole _changes feed; this was somewhat confirmed by another commenter on Stack Overflow: http://stackoverflow.com/a/10422892/179583
>
> hth,
> -nvw

Re: API to list deleted docs, or deleted revs of a doc?

Posted by Nathan Vander Wilt <na...@calftrail.com>.
On Aug 31, 2012, at 3:35 PM, Jens Alfke wrote:
> I’m writing a GUI app to browse the contents of databases, mostly for debugging/troubleshooting purposes. It currently lists all the existing documents, as Futon does, but I’d like to be able to show all the _deleted_ documents too. But I can’t find a query in the API that will do that. Effectively I want something like “GET /db/_all_docs?includedeleteddocstoo=true”. Is there such a thing?

The only way I know of to gain an "entry point" into deleted documents (unless you know their _ids?) is to filter through the whole _changes feed; this was somewhat confirmed by another commenter on Stack Overflow: http://stackoverflow.com/a/10422892/179583

hth,
-nvw