This is a talk I presented at University Limerick to give people an introduction into CouchDB.
What is it? How does it generally work? Introducing new concepts, etc.
6. 32 CouchDB servers
2 datacenters
SSL based user auth, sharding, etc.
This is the only BBC transparent logo I found and it’s not BBC World News using CouchDB but BBC.
See: http://www.erlang-factory.com/conference/London2009/speakers/endafarrell
20. MAP
%% Map Function
fun({Doc}) ->
case {proplists:get_value(<<"firstname">>, Doc)} of
{undefined} ->
false;
{Name} ->
Emit(Name, Doc);
_ ->
ok
end
end.
21. fun({Doc}) ->
Emitter = fun(Doc) ->
Name = proplists:get_value(<<"name">>, Doc, null),
Emit(Name, Doc)
end,
HasRequiredFields = fun(Doc) ->
case {proplists:is_defined(<<"firstname">>, Doc)} of
{true} ->
Emitter(Doc);
_->
false
end
end,
HasRequiredFields(Doc)
end.