pymongo 4.0的‘Cursor‘ object has no attribute ‘count‘异常
pymongo 模块的 Cursor 对象在 2021年11月30日 之后因为更新到 4.0 版本,删除了 Cursor 类里的 count 方法,以下是 4.0 和 3.12.2 两个版本的 Cursor 类对比:https://github.com/mongodb/mongo-python-driver/blob/4.0/pymongo/cursor.pyhttps://github.com
·
pymongo 模块的 Cursor 对象在 2021年11月30日 之后因为更新到 4.0 版本,删除了 Cursor 类里的 count 方法,以下是 4.0 和 3.12.2 两个版本的 Cursor 类对比:
https://github.com/mongodb/mongo-python-driver/blob/4.0/pymongo/cursor.py
https://github.com/mongodb/mongo-python-driver/blob/3.12.2/pymongo/cursor.py
最快的解决方案是:指定一下 pymongo 的版本,不要使用最新的 4.0 版本
更多推荐
已为社区贡献5条内容
所有评论(0)