【发布时间】:2013-09-13 05:00:58
【问题描述】:
我有一个文本模型;
class Text(db.Document):
siphash_value = db.LongField()
然后我使用 siphash 库创建哈希。(https://github.com/majek/pysiphash)
此库将字符串转换为长值,例如 12398370950267227270L
如果我尝试将文档保存到我的数据库;
Text(siphash_value=12398370950267227270L).save()
我收到此错误:
OverflowError: MongoDB can only handle up to 8-byte ints
【问题讨论】:
-
我现在正在使用这个库 github.com/bozhu/siphash-python 并且工作正常。
标签: mongodb mongoengine flask-mongoengine