map function for link-walking

Bryan Fink bryan at
Sun Jul 11 11:03:07 EDT 2010

On Sun, Jul 11, 2010 at 9:19 AM, Nicolas Fouché <nicolas at> wrote:
> I did not find any doc about preloading javascript functions. Is it
> the same as storing JS files in a bucket and load them thanks to the
> "bucket" and "key" fields, as described in the "Map" paragraph of the
> Fast Track ?

Oops.  You're right - we haven't documented this feature well.  The
best I've found is Kevin Smith's reply to another thread on this list:

It involves modifying your app.config file to set the js_source_dir
variable for the riak_kv app.  For a good example of how to structure
a preloaded-JS file, check out the one that ships with Riak:

All of the functions in that file are available to Javascript
map/reduce functions as Riak.<function name>.  Those functions will
still be available even after you set js_source_dir.  You might
consider wrapping your application's useful functions in a MyApp class
or some such.

It's also useful to know about "bin/riak-admin js_reload" if you're
doing this.  That command will re-read all of your preloaded
Javascript files.


More information about the riak-users mailing list