Created
September 22, 2011 14:33
-
-
Save voluntas/1234920 to your computer and use it in GitHub Desktop.
sample.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment