简体   繁体   English

连接到mongo db时光标实例错误?

[英]Cursor Instance Error when connecting to mongo db?

I have a web application that uses flask and mongodb. 我有一个使用flask和mongodb的Web应用程序。 I recently downloaded a clone of it from github onto a new Linux machine, then proceeded to run it. 我最近从github将其克隆下载到新的Linux机器上,然后继续运行它。 It starts and runs without any errors, but when I use a function that needs access to the database, I get this error: 它启动并运行没有任何错误,但是当我使用需要访问数据库的函数时,出现此错误:

File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 533, in __ getitem__ raise IndexError("no such item for Cursor instance") IndexError: no such item for Cursor instance __ getitem__中的文件“ /usr/local/lib/python2.7/dist-packages/pymongo/cursor.py”,行533引发IndexError(“ Cursor实例无此项目”)IndexError:Cursor实例无此项目

This isn't happening on any of the other computers running this same application. 运行此相同应用程序的其他任何计算机上都不会发生这种情况。 Does anybody know what's going on? 有人知道发生了什么吗?

Well, it ended up being an issue with the String specifying the working directory. 好吧,这最终成为指定工作目录的字符串的问题。 Once it was resolved I was able to connect to the database. 解决之后,我就可以连接到数据库了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM