First I want to receive new messages and try the following:
db.posts.find({"date": {"$lt": tomorrow, "$gte": today}}).sort({'date':pymongo.DESCENDING})
(without sorting , I get the oldest messages first)
I get this error
TypeError: if no direction is specified, key_or_list must be an instance of list
What's going on here? Can't sort by date?
source share