Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import riak
- client = riak.RiakClient(port=8087, transport_class=riak.RiakPbcTransport)
- bucket = client.bucket('bucket')
- john = bucket.new('john', {'name': 'john', 'job': 'programmer', 'age': '27'})
- john.set_indexes({'job_bin': 'programmer', 'age_int': 31})
- john.store()
- results = client.index('bucket', 'age_int', 30, 50).run()
- # Python 2.6, 2.7 json.loads function return unicode.
- key = results[0].get_key()
- results[0].get()
- # raise TypeError: Unicode bucket names are not supported.
Add Comment
Please, Sign In to add comment