incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Binns <rog...@rogerbinns.com>
Subject Re: filters for _changes dont seem to work
Date Sat, 28 Nov 2009 06:03:24 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

slubowsky@netzero.net wrote:
> I am trying to use a simple filter to filter the changes I get when asking for changes
using the _changes API. 
> 
> I find that often the filter is not even called 

I am seeing the same behaviour.  For example if two documents are added in
rapid succession the filter function is only called for the first one.  My
filter function doesn't do "fancy" stuff like look at the request:

function(doc,req) {
  //  log('filter called '+toJSON(doc));
  return doc.type=="collection" || doc._deleted==true;
}

> What typically happens is that the first couple of changes do get through as expected
(and I see
> the appropriate log messages written by the filter) but then after a few updates, my
filter doesn't 
> even get called (I see no log messages from my filter) and couch seems to decide on its
own not 
> include the change but just updates the last_seq number and sends that.

My swag is it seems to be some sort of race condition.  In most cases I only
get the first change filtered.  I do some other queries and then issue the
change request again.  Things seem to work ok when using firefox manually
altering the URL for each change.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksQvSsACgkQmOOfHg372QR6nwCZAZLSdSnJAKnDhNz3UQXdmdwf
qg4AoJJY62Yu/MilUHkbo/K4Z0RIOt1Y
=mQ0u
-----END PGP SIGNATURE-----

Mime
View raw message