How can I write map-reduce functions in Erlang for CouchDB? I am sure Erlang is faster than JavaScript.
+5
A:
You can do so using erlview, which is within the top ten hits on Google for "couchdb erlang view" and is listed on the CouchDB wiki page for other-language view servers.
Jim Puls
2009-07-23 08:24:17
Snarky Jim is snarky. And correct.
James A. Rosen
2009-07-23 12:40:03
With the next release of CouchDB erlang views will be built in. You won't even have to download and setup erlview to make it work.
Jeremy Wall
2009-08-21 03:38:19
CouchDB 0.10 (released October 2009) and later support Erlang views natively. A good writeup is at http://blog.echolibre.com/2010/02/couchdb-custom-erlang-map-functions/
jhs
2010-06-12 07:51:48
+7
A:
pmap(F, L) ->
Parent = self(),
Pids = [spawn(fun() ->
Parent ! {self(), F(X)}
end) || X -> L],
[receive {Pid, Res} -> Res end || Pid < - Pids].
I believe I did, Bob.
Fu
2009-07-23 21:26:02