how to do a key filter using the python api for map reduce

David Montgomery davidmontgomery at gmail.com
Thu Aug 30 08:12:44 EDT 2012


I did not scroll down far enough in the api docs regarding python.  Problem solved.

Sent from my iPad

On Aug 30, 2012, at 6:51 PM, David Montgomery <davidmontgomery at gmail.com> wrote:

> Hi,
> 
> I am using the python api.
> 
> I need to do a key filter kinda like this.
> 
> 
> "inputs":{
>     "bucket":"impressions"
>     "key_filters":[["tokenize", ":", 2],["starts_with", "2012"]]
>   },
> 
> 
> But from the python api docs...I have a query that looks like this.
> 
> 
> query = client.add('impressions')
> query.map("""function(v) { 
>                         var data = JSON.parse(v.values[0].data); 
>                         return [[v.key, data]]; 
>                         }""")
> for result in query.run():
>    print "%s - %s" % (result[0], result[1])
> 
> 
> Where and how do I place the key_filters[]?  
> 
> Thanks
> 
> Sent from my iPad




More information about the riak-users mailing list