There was an error while loading. Please reload this page.
Source File on GitHub
This Erlang function will save the output of a map to a bucket and key (passed by argument).
-module(reduce_functions). %%Function assumes JSON values -export([save_reduce/2]). %%Arg is a [bucket, key] combination save_reduce([Data | _], [Bucket, Key]) -> {ok, C} = riak:local_client(), Json = iolist_to_binary(mochijson2:encode(Data)), Object = riak_object:new(Bucket, Key, Json, "application/json"), C:put(Object, 1), []; save_reduce(_, _) -> [].
Home
Map/Reduce Functions
Pre and Post Commit Hooks
Other Functions