include mapByFields in riak by default

Andy Gross andy at basho.com
Sat Jun 12 12:04:46 EDT 2010


I'm already all up in Bugzilla today, so I just created
http://issues.basho.com/show_bug.cgi?id=237 to track this.  I'm in favor of
adding it too.

Andy Gross <andy at basho.com>
VP, Engineering
Basho Technologies, Inc.
http://basho.com


On Sat, Jun 12, 2010 at 9:53 AM, Sean Cribbs <sean at basho.com> wrote:

> Best thing is to open a Bugzilla issue so it can get scheduled for a
> release.  I for one am in favor of it.
>
> Sean Cribbs <sean at basho.com>
> Developer Advocate
> Basho Technologies, Inc.
> http://basho.com/
>
> On Jun 12, 2010, at 9:44 AM, francisco treacy wrote:
>
> > So what do you guys think? It is a bad idea?
> >
> > 2010/6/6 francisco treacy <francisco.treacy at gmail.com>:
> >> I find myself using a lot this kind of functions (this one
> >> inspired/borrowed from Sean Cribbs) - a sort of SQL's conditions
> >> ("where").
> >>
> >> Riak.mapByFields = function(value, keyData, fields) {
> >>   if(!value.not_found){
> >>     var object = Riak.mapValuesJson(value)[0];
> >>     for(field in fields) {
> >>         if(object[field] != fields[field])
> >>             return [];
> >>     }
> >>     return [object];
> >>   } else {
> >>     return [];
> >>   }
> >> }
> >>
> >> Usage:
> >> {"inputs":"test",
> >>  "query":[{"map":{"language":"javascript",
> >>                  "name":"Riak.mapByFields",
> >>                  "arg": { "city": "Paris" },
> >>                  "keep":true}}]
> >> }
> >>
> >> Any real-world app *always* needs to query data by fields.
> >>
> >> Would it be a good idea to ship this by default in Riak?  I do believe
> >> so because it is sufficiently general purpose (just as
> >> Riak.mapValuesJson).
> >>
> >> A lot of libraries (for instance devise-ripple) could build upon this
> >> function without forcing clients/users to alter their app.config,
> >> define a js_source, and include the function in all their nodes.
> >>
> >> What do you think?
> >>
> >> Francisco
> >>
> >
> > _______________________________________________
> > riak-users mailing list
> > riak-users at lists.basho.com
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
> _______________________________________________
> 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/20100612/99a64ee7/attachment.html>


More information about the riak-users mailing list