我正在本地jupyter中运行一些python脚本,并将字典作为文档插入mongodb中(在AWS云上运行),并且已成功插入。但是在云ubuntu实例上运行相同的代码时,则会引发以下错误:
File "/usr/local/lib/python2.7/dist-packages/pymongo/pool.py", line 482, in command
self._raise_connection_failure(error)
File "/usr/local/lib/python2.7/dist-packages/pymongo/pool.py", line 610, in _raise_connection_failure
raise error
bson.errors.InvalidDocument: Cannot encode object: 0
是否存在任何pymongo版本问题,因为本地pymongo为3.4,云pymongo为3.5