You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Stefan Klein <st...@gmail.com> on 2014/05/05 14:00:36 UTC

filter changes feed for deletes of a specific document type

Hi,

I try to find a way to get deletes of documents with a specific type* from
the changes feed.
>From the documentation I don't see a way, neither with filters nor with
using a view as a filter, since both only get the current, deleted revision
where the type is already gone.
Also tried to get the last non-deleted revision from the database using a
get on the documentid with a combination of rev, revs, meta and but a
deleted document is deleted .. so all i get is a 404 reason: deleted.

Am I missing something, is there a workaround?

* i refer to the quasi standard doc.type = 'myType'

thanks,
Stefan

Re: filter changes feed for deletes of a specific document type

Posted by Johannes Jörg Schmidt <sc...@netzmerk.com>.
I find it useful to include the type in the document id string. This way
you can always see which type of document you're dealing with. I have
made a little module, which helps in standardizing the id schema: docuri
[1].
You can also leave the type when deleting a document. Just put the
document with a _deleted: true field.

Greetings
Johannes

[1] https://github.com/jo/docuri

On 05.05.2014 14:00, Stefan Klein wrote:
> Hi,
> 
> I try to find a way to get deletes of documents with a specific type* from
> the changes feed.
> From the documentation I don't see a way, neither with filters nor with
> using a view as a filter, since both only get the current, deleted revision
> where the type is already gone.
> Also tried to get the last non-deleted revision from the database using a
> get on the documentid with a combination of rev, revs, meta and but a
> deleted document is deleted .. so all i get is a 404 reason: deleted.
> 
> Am I missing something, is there a workaround?
> 
> * i refer to the quasi standard doc.type = 'myType'
> 
> thanks,
> Stefan
>