Storing JS functions in bucket/keys

Jonathan Langevin jlangevin at loomlearning.com
Mon Mar 26 21:57:03 EDT 2012


Missed that, thanks very much.

So it seems in that example, I would have an anonymous function stored in
myjs/mymap, correct?

Would it be possible to store a group of functions into a bucket,
structured similar to the Riak builtin js methods, that I could call from a
map phase w/ a custom function?

I know this would be simpler if the lib were simply included in Riak's js
includes for each node, but I'm trying to put together a function lib for a
client library that would ideally not require any server-side modification.
I have a group of functions that may cross reference each other, and while
some would be called directly for a map phase, others would be helpers for
custom map functions, so I'm attempting to achieve something similar to the
Riak built-in js accessibility, without server modification.

Thanks!

*
 <http://www.loomlearning.com/>
 Jonathan Langevin
Manager, Information Technology
Loom Inc.
Wilmington, NC: (910) 241-0433 - jlangevin at loomlearning.com -
www.loomlearning.com - Skype: intel352
*


On Mon, Mar 26, 2012 at 5:04 PM, Russell Brown <russell.brown at me.com> wrote:

> 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!
>
>  <http://www.loomlearning.com/>
> * 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/dcb24c51/attachment.html>


More information about the riak-users mailing list