In mongoshell, the below statement is working fine:
db.grades.find({'type':'homework'}).sort({$score:1})
But when I am trying to do same in pymongo, i am facing an error:
itr= collection.find({'type':'homework'}).sort(['score', pymongo.ASCENDING])
Error:
for (key, value) in index_list:
ValueError: too many values to unpack