couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <fdman...@gmail.com>
Subject Re: Filters in Erlang broken
Date Fri, 16 Apr 2010 17:31:50 GMT
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 <fdmanana@gmail.com>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 <paul.joseph.davis@gmail.com>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 <ivan.bodunov@gmail.com>
>> 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,
> fdmanana@gmail.com
>
> "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,
fdmanana@gmail.com

"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message