【发布时间】:2015-06-05 14:47:16
【问题描述】:
这是我的 python 程序,它与 mongodb* 建立连接
import pymongo
from pymongo import MongoClient
connection = MongoClient('localhost', 27017)
db = connection.test
names = db.names
item =names.find_one()
print item('name')
而且,我收到了这个错误
C:\Users\hpg6\Desktop>python mycon.py
Traceback (most recent call last):
File "mycon.py", line 15, in <module>
print (item('name'))
TypeError: 'dict' object is not callable
【问题讨论】: