Map function in erlang that takes entire bucket as input?

Sean Cribbs sean at
Thu Jan 10 09:07:59 EST 2013


While you may be able to specify the entire bucket as input, map
functions only operate on a single input object. If you want to
operate across the entire set, use reduce. (Note that in order to
fetch the objects, you will need a map phase, even if it just returns
its input.)

On Thu, Jan 10, 2013 at 12:56 AM, Shaan Sapra <shaanfire at> wrote:
> Hi all,
> I'm exploring the erlang-riak-client and trying to write MapReduce functions
> to mimic the ones I've written in Javascript and in the riak-ruby-client.
> Following the tutorial here, I have successfully run the query. I have now
> loaded a bucket with 10000 keys into Riak and now I want to write a simple
> map function that queries the bucket and returns all of the objects back to
> me.
> I noticed that the input is specified as {<<"groceries">>, <<"mine">>}. Is
> there is a way to specify just the bucket in its entirety? If I wanted to
> query my bucket, would I have to list all 10000 keys in a list?
> In the riak-ruby-client, it was possible to add the entire bucket.
> Thanks for any help! I'm sure this is a silly question, but I've been hard
> pressed to find good documentation for a novice like me.
> Shaan
> _______________________________________________
> riak-users mailing list
> riak-users at

Sean Cribbs <sean at>
Software Engineer
Basho Technologies, Inc.

More information about the riak-users mailing list