Storing JS functions in bucket/keys

Russell Brown russell.brown at me.com
Mon Mar 26 17:04:13 EDT 2012


Hi Jonathan,

On 26 Mar 2012, at 21:53, Jonathan Langevin wrote:

> It was mentioned in an old webinar recap, that custom JS functions could be stored in Riak as a objects in a bucket, and then executed via mapreduce.
> While this was mentioned as possible, no example was provided, and Google is turning up nothing useful for me.
> 
> Could someone please provide an example of how custom JS functions stored in a Riak bucket could then be used against results of a map or reduce phase?
> 
> Recap article: 
> http://basho.com/blog/technical/2010/07/27/webinar-recap---mapreduce-querying-in-riak/  (over halfway down, mentions that functions could be stored in bucket/key) 

There is an example in the wiki documentation here http://wiki.basho.com/MapReduce.html#Map, it describes the specification

    {"map":{"language":"javascript","bucket":"myjs","key":"mymap"}}

You'd need to store an object who's value was a valid javascript phases function at 'myjs'/'key'.

Cheers

Russell

> 
> Thanks!
> 
> 
> Jonathan Langevin
> Manager, Information Technology
> Loom Inc.
> Wilmington, NC: (910) 241-0433 - jlangevin at loomlearning.com - www.loomlearning.com - Skype: intel352
> 
> 
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120326/96ac9b17/attachment.html>


More information about the riak-users mailing list