在我与瓶应用我已经导入pymongo:from pymongo import MongoClient
MongoClient不可调用,但为什么?
然后,我打电话给我的connect_db法:
db = get_db(connect_db())
方法编码是这样的:
def connect_db():
client = MongoClient("localhost", 27017)
return client
def get_db(client):
return client(DATABASE)
但我得到的错误TypeError: 'MongoClient' object is not callable
我发现它在https://api.mongodb.org/python/current/tutorial.html
是什么原因?