couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boazc <>
Subject (Dynamically) excluding documents from a view query
Date Tue, 16 Oct 2012 09:50:17 GMT

My documents contain tags which have a corresponding view.
I want to retrieve all documents that contain a certain tag, but don't
contain another one.
(Note that I don't know about the possible tags in advance).

id: doc1, tags: [a, b]
id: doc2, tags: [b, c]
id: doc3, tags: [a, c]
If I want all docs with tag=a but not tag=b I expect to get only doc3.

Is there a way to achieve this on CouchDB side?
Needless to say I cannot do it on the client side as I cannot benefit from
pagination and anyway might receive an extreme set of documents I need to
work on.

I know I can turn to some search engines e.g. ElasticSearch or
CouchDB-Lucene, but other than introducing a new component to the system it
also means an inherent delay between the "real" data and the indexed data
which in my domain is unacceptable.


View this message in context:
Sent from the CouchDB Development mailing list archive at

View raw message