-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Invalid] Python-调用mongodb功能无法使用 #419
Labels
invalid
This doesn't seem right
Comments
很明显pip不是你命令行那个pip,估计用了mac的自带的python2吧,重复的问题可以不用提issue |
ZhouYixun
changed the title
[Bug] Python-调用mongodb功能无法使用
[Invalid] Python-调用mongodb功能无法使用
Mar 12, 2024
ZhouYixun
added
invalid
This doesn't seem right
and removed
bug
Something isn't working
labels
Mar 12, 2024
我这个不是重复的bug,这个bug不是用的mac系统,agent是windows10系统,麻烦帮忙执行下这串代码呢。另外我查了不是用的mac自带的python2,python -version出来的是python3呢。辛苦帮忙瞅瞅呢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search before asking
Sonic version
version2.6.4
Deploy platform
agent:windows10系统
server:ubuntu系统
Minimal reproduce step
import pymongo
class Mongodb:
def connect_mongodb(self):
if name == 'main':
mongoUtil = Mongodb()
result = mongoUtil.connect_mongodb()
Traceback (most recent call last):
File "D:\software\sonic-agent-v2.6.2-windows_x86_64\test-output\db2f1a7e-9452-40a8-a41b-36a0175bd9d8.py", line 16, in
result = mongoUtil.connect_mongodb()
File "D:\software\sonic-agent-v2.6.2-windows_x86_64\test-output\db2f1a7e-9452-40a8-a41b-36a0175bd9d8.py", line 8, in connect_mongodb
rs = db.gmMessageEmail.find().sort({"createTime":-1}).limit(1)
File "D:\Program Files\Python3\lib\site-packages\pymongo\cursor.py", line 873, in sort
keys = helpers._index_list(key_or_list, direction)
File "D:\Program Files\Python3\lib\site-packages\pymongo\helpers.py", line 90, in _index_list
raise TypeError("if no direction is specified, key_or_list must be an instance of list")
TypeError: if no direction is specified, key_or_list must be an instance of list
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: