0
for element in self.table1.find({'ji': {'$ne': ""}}):
gongLiNian = int(element['gongLiNian'])
gongLiNianScope = [str(gongLiNian-1), str(gongLiNian), str(gongLiNian+1)]
res = self.table2.find_one({'guanZhi' : element['guanZhi'],
'gongLiNian' : {'$in', gongLiNianScope},
'name' : element['name']})
對於這段代碼,這裏是錯誤:
Traceback (most recent call last):
File "C:\Users\elqstux\Desktop\study\History\oneJi.py", line 172, in <module>
oneJi.run()
File "C:\Users\elqstux\Desktop\study\History\oneJi.py", line 158, in run
res1 = self.step1()
File "C:\Users\elqstux\Desktop\study\History\oneJi.py", line 44, in step1
'gongLiNian' : {'$in', gongLiNianScope},
TypeError: unhashable type: 'list'
但我無法找到從error.Could你能給我一些建議任何線索?