0
当运行该代码,我得到一个错误“CommandCursor”对象不是标化的 pymongo版本= 3.3.0“CommandCursor”对象不是标化的
try:
myresults = students.aggregate([{"$unwind":"$scores"},{"$match":{"scores.type":"homework"}},{"$group":{"_id":"$_id","minitem":{"$min":"$scores.score"}}}],useCursor=False)
for result in myresults['result']:
scores.update({"_id":result["_id"]},{"$pull":{"scores":{"score": result["minitem"]}}})
except Exception as e:
raise