You need a 3rd argument in your erlang filter function. This 3rd argument is the user context.
I created a ticket at https://issues.apache.org/jira/browse/COUCHDB-740 with a patch attached to make that third parameter optional and add a test. I dunno if it should be made optional or stay as mandatory. On Fri, Apr 16, 2010 at 10:41 AM, Filipe David Manana <[email protected]>wrote: > If nobody is already working on a fix, I can spend some time on it. > > > On Fri, Apr 16, 2010 at 4:49 AM, Paul Davis > <[email protected]>wrote: > >> Someone refactored couch_native_process.erl and forgot to update the >> design doc interaction thinger with random functions. >> >> In other words, it expects an argument like {_, Func} but gets >> ["filters", "foo"] IIRC. >> >> On Thu, Apr 15, 2010 at 8:18 PM, Ivan Bodunov <[email protected]> >> wrote: >> > Hi, >> > >> > After I wrote my filter in JavaScript I decided to rewrite it in Erlang >> and >> > faced some problems. >> > Even the simplest possible filter written in Erlang causes crashes in >> > CouchDB. >> > >> > Filter is >> > "filters": { "foo": "fun({Doc},Req) -> true end." } >> > >> > Command to trigger the filter is >> > # curl -X GET http://localhost:5984/mytemp/_changes?filter=erl/foo >> > >> > Following link contains the crash report: >> > http://friendpaste.com/6eFpPOtTaaSRiXEvaUEmrZ >> > >> > CouchDB 0.11 on Mac. >> > >> > Ivan >> > >> > > > > -- > Filipe David Manana, > [email protected] > > "Reasonable men adapt themselves to the world. > Unreasonable men adapt the world to themselves. > That's why all progress depends on unreasonable men." > > -- Filipe David Manana, [email protected] "Reasonable men adapt themselves to the world. Unreasonable men adapt the world to themselves. That's why all progress depends on unreasonable men."
