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

David Montgomery davidmontgomery at gmail.com
Thu Aug 30 06:51:02 EDT 2012


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