incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: changes filter written in erlang
Date Sat, 22 May 2010 21:01:06 GMT
Hi Matthew,

On 20 May 2010, at 03:53, Matthew Sinclair-Day wrote:

> I'm looking for an example of a changes filter written in erlang that uses a query argument
passed in the request.  I looked on the wiki and did not see an example of the erlang function
prototype.

here's one from the CouchDB test suite: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/changes.js?view=markup
line 368 (it doesn't exercise the query parameter though).

fun({Doc}, Req) ->
  Value = couch_util:get_value(<<"value">>, Doc),
  (Value rem 2) =:= 0
end.

A good rule of thumb is skimming through the test suite for things that are barely documented.
Also, sorry about that :)

Cheers
Jan
--


Mime
View raw message