当我尝试使用 Iron Python 连接到 mongodb(使用 pymongo)时出现此错误...
Traceback (most recent call last):
File "test.py", line 3, in <module>
File "c:\Program Files (x86)\IronPython 2.7\lib\site-packages\pymongo\connecti
on.py", line 179, in __init__
File "c:\Program Files (x86)\IronPython 2.7\lib\site-packages\pymongo\mongo_cl
ient.py", line 269, in __init__
pymongo.errors.ConnectionFailure: Specified cast is not valid.
代码很简单,我已经替换了数据库名称。
import pymongo
c = pymongo.Connection('mongodb://testuser:test123@linus.mongohq.com:10021/sometestdb')
它适用于常规 python。有任何想法吗?