With PyMongo, when I try to retrieve objects sorted by their 'number' and 'date' fields like this:
db.test.find({"number": {"$gt": 1}}).sort({"number": 1, "date": -1})
I get this error:
TypeError: if no direction is specified, key_or_list must be an instance of list
What's wrong with my sort query?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…