title: Mongoengine: How to sort Embedded Document list by Embedded document field
body: <p>So what I'm after is something like:</p>
  
  <pre><code>class Comment(EmbeddedDocument):
      content = StringField()
      upvotes = IntField()
      pub_date = DateTimeField()
  
  class Post(Document):
      title = StringField()
      comments = SortedListField(EmbeddedDocumentField(Comment))
      post_date = DateTimeField()
  </code></pre>
  
  <p>By default, this sorts by the chronological order of comment submission, but I want to make the <code>SortedListField</code> sort by the <code>upvotes</code> attribute of the embedded comment documents. Is this possible, and if so how do I go about it?</p>