Closed ceremcem closed 7 years ago
Hey, I'm having some trouble reproducing this. I'm using this example filter from the CouchDB docs:
{
"_id": "_design/app",
"filters": {
"important": "function(doc, req) { if(doc.priority == 'high') { return true; }
else { return false; }}"
}
}
And instantiating the follow client like so:
var feed = new follow.Feed();
feed.db = 'http://localhost:5984/testdb';
feed.filter = 'app/important';
feed.on('change', function(change) {
console.log(`got change for doc ${change.id} (seq: ${change.seq})`);
});
feed.on('error', function(er) {
throw er;
});
feed.follow();
Are you able to query the changes feed via curl
without problems? Something similar to this:
curl 'http://localhost:5984/testdb/_changes?filter=app/important'
I'm wondering if something odd is happening on the server side, i.e. the connection is timing out. Is the filter function quite complex?
Thanks.
Hmmm... The problem seems that I'm actually trying to get the changes for a view
, instead of a filter
.
As title says,
feed.filter = "mydesigndoc/myview"
is not working. This error is thrown:If a valid function is passed, it works.