我第一次尝试使用mongodb和python(使用eclipse)
import pymongo
connection = pymongo.Connection("localhost",27017)
db=connection.test
db.name
出现此错误:
Traceback (most recent call last):
File "C:\Users\chatterjees\workspace\de.vogella.python.first\src\FirstModule.py", line 2, in <module>
connection = pymongo.Connection("localhost",27017)
File "build\bdist.win32\egg\pymongo\connection.py", line 381, in __init__
File "build\bdist.win32\egg\pymongo\connection.py", line 659, in __find_node
pymongo.errors.AutoReconnect: could not connect to localhost:27017: [Errno 10061] No connection could be made because the target machine actively refused it