哪里出问题了
来源:2-1 pymongo的安装与使用(请与老师保持同版本)
慕妹2590417
2021-10-23 16:20:42
client.school.teacher.updat_one({'name':'李璐'},{'$set':{'sex':'女'}})
问题描述:
Traceback (most recent call last):
File "E:\python\mongodb\update.py", line 4, in <module>
client.school.teacher.updat_one({'name':'李璐'},{'$set':{'sex':'女'}})
File "E:\python\mongodb\venv\lib\site-packages\pymongo\collection.py", line 3491, in __call__
raise TypeError("'Collection' object is not callable. If you meant to "
TypeError: 'Collection' object is not callable. If you meant to call the 'updat_one' method on a 'Collection' object it is failing because no such method exists.
1回答
好帮手慕凡
2021-10-23
同学,你好!
update_one拼写错误,导致报错,如下图:
祝学习愉快~
相似问题