Simple question: I would like to react to some changes in a database, but only to those changes which are causing modifications in a certain view1. That is, I am not interested in all changes in the database, just those changes which are affecting view1. I am not talking about filter here, just about view+changes. Something like this (although this is probably not correct):
http://localhost:5984/db/_design/doc1/_view/view1/_changes
Is this at all supported by CouchDB? Does this makes sense at all?
It’s possible, but in a little another way. Since 1.1.0 release CouchDB is able to use map function as filters for changes feed. This works as like regular filters: if key-value pair was emitted at least once for changed document it means that he passes filter and
_changesyields the record about him. If you need get only new updates for specific view, you need to specify staringsinceseq number – it could be easily retrieved from_design/ddoc-name/_inforesource from fieldview_index/update_seq. Since 1.3 release you may also specifysince=nowto listen updates from current point of time.Note, that this view filters doesn’t uses view index and doesn’t updates him while new changes occurs. Also, there is set of patches that improves view filters in the way that you may be also interested.