sort in mongoengine

class Person(Document):
    first_name = StringField()
    last_name = StringField()
    age = IntField()

# later
people = Person.objects.order_by('last_name', '-age')

This entry was posted on 2018 年 01 月 09 日 and is filed under pplife. Written by: . You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.