couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Gonzalez <gonva...@gonvaled.com>
Subject Are CouchDB filters limited to the _changes feed?
Date Sun, 29 Jan 2012 16:54:08 GMT
Hello,

As specified here
(http://guide.couchdb.org/draft/notifications.html#filters), a filter
can be used with the _changes feed like this:

curl "$HOST/db/_changes?filter=app/important"

Now I am trying to use this pattern with a standard view access, like this:

curl -X GET $HOST/db/_design/live_data/_view/all-comments&filter=live_data/bytag?tag=testing

I have also tried ? instead of &:

curl -X GET $HOST/db/_design/live_data/_view/all-comments?filter=live_data/bytag?tag=testing

But the filter has no effect: all documents are shown, even those
which should not be validated by the filter.

The filter that I am using is:

function(doc, req)
{
  for( var i in doc.tags ) {
    if(doc.tags[i] == req.query.tag) {
      return true;
    }
  }
  return false;
}

- Am I doing something wrong in the curl calls?
- Is it at all possible to use views together with filters, or are
filters limited to the _changes feed? I have seen no examples of
filters except related to _changes

Thanks,
Daniel Gonzalez

Mime
View raw message