Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.46 KB | None | 0 0
  1. fun({Doc}) ->
  2.   DocType = couch_util:get_value(<<"type">>, Doc),
  3.   L = [1, 2, 3, 4],
  4.   M = #{<<"id">> => <<"1234">>, <<"brand">> => <<"value one">>, <<"a">> => <<"1">>},
  5.   case DocType of
  6.     <<"installedbaselocation">> ->
  7.       DocInstalledbase = couch_util:get_value(<<"installedbase">>, Doc),
  8.       lists:foreach(fun(E) ->
  9.         Id = 1, % lists:last(<<"id">>, tuple_to_list(E)),
  10.         Emit(Id, E)
  11.       end, DocInstalledbase);
  12.     _ -> false
  13.   end
  14. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement