I'm trying to write a map phase for riak in erlang and I've hit a problem. I need to concatenate a description and a code, which are separate items and combine them in the form "code-description", which then needs to be given a value of 1 so "code-description"=1 to allow me to count the same occurrences in my reduce phase (The descriptions are from a static pool, not free text). The dash is also important. Using proplists I can navigate to the values I want and using {struct, values} = ...etc I get something along the lines:
[{"desc":"Stuff Needs Doing","code":"SND"},{"desc":"Done","code":"DNE"}]
When I write the following snippet I get just the desc returning for each kv in my filtered list:
Desc = proplists:get_value(<<"desc">>, Data),
[Desc].
Seeing as how they are both character data I thought that [DescVar ++ CodeVar]. would work but when I ran it against my cluster I actually got an error message and it complains about the ++. + doesn't work either so how do I do what I'm after in erlang?