@
xiaolinjia list 的类型是 pymongo.cursor.Cursor db[index + 1]['a'] 就提示错误了
-----
Traceback (most recent call last):
File "C:/python/
t.py", line 10, in <module>
if (item['code'] == db[index + 1]['code']):
File "C:\python\venv\lib\site-packages\pymongo\
cursor.py", line 612, in __getitem__
self.__check_okay_to_chain()
File "C:\python\venv\lib\site-packages\pymongo\
cursor.py", line 401, in __check_okay_to_chain
raise InvalidOperation("cannot set options after executing query")
pymongo.errors.InvalidOperation: cannot set options after executing query