I'm just learning how to use MongoDB by using MongoEngine from Python. Simply getting all users is done as follows:
User.objects
I now want to order the users on their creation date. In the MongoDB docs I found something about .sort(), but in the MongoEngine docs I can't find anything about sort. I also tried using the following:
User.objects.sort('created')
but this leads to an AttributeError: 'BaseQuerySet' object has no attribute 'sort'
.
So does anybody know how I can sort MongoDB results using MongoEngine? All tips are welcome!