Skip to content

Instantly share code, notes, and snippets.

@davidcoallier
Created February 15, 2010 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidcoallier/304740 to your computer and use it in GitHub Desktop.
Save davidcoallier/304740 to your computer and use it in GitHub Desktop.
%% Map Function
%% Thanks to Adam Kocoloski (@kocolosk) for this compacted version
fun({Doc}) ->
case {proplists:get_value(<<"name">>, Doc), proplists:get_value(<<"value">>, Doc)} of
{undefined, _} ->
ok;
{_, undefined} ->
ok;
{Name, Value} ->
Emit(Name, Value);
_ ->
ok
end
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment