软件版本:python2.7,pymongo3.2 ,MongoDB3.2
错误信息:在用find_one方法查询时 data=db.find_one({'cid':tempDict['cid']}) ,抛出如下错, 查了好久也没查出原因。
File "build/bdist.linux-x86_64/egg/pymongo/collection.py", line 1006, in find_one
for result in cursor.limit(-1):
File "build/bdist.linux-x86_64/egg/pymongo/cursor.py", line 1097, in next
if len(self.__data) or self._refresh():
File "build/bdist.linux-x86_64/egg/pymongo/cursor.py", line 1019, in _refresh
self.__read_concern))
File "build/bdist.linux-x86_64/egg/pymongo/cursor.py", line 905, in __send_message
helpers._check_command_response(doc['data'][0])
File "build/bdist.linux-x86_64/egg/pymongo/helpers.py", line 196, in _check_command_response
raise OperationFailure(msg % errmsg, code, response)
OperationFailure: could not find host matching read preference { mode: "primary", tags: [ {} ] } for set rs1
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。