Created
February 25, 2012 00:15
-
-
Save jimklo/1904807 to your computer and use it in GitHub Desktop.
try to figure out collation in couchdb
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
from couchdb.client import Server | |
server = Server() | |
db = server['collation-test'] | |
try: | |
for idx in range(65535): | |
db.save( {'unichr':unichr(idx), 'code': idx, 'hex': str(hex(idx))} ) | |
print "{0}\n".format(hex(idx)) | |
except Exception, e: | |
raise e |
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
function(doc) { | |
log(doc.code + " hex:"+doc.hex); | |
emit(doc.unichr, doc.hex); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's easy to handle insert failure: