0

I am using django-mongodb-engine.

I have example data as below:

{
    "name":[{"first_name":"rajat","last_name":"verma"},{"first_name":"jay","last_name":"patil"},]
}

Now I want to apply sorting on first_name field. I tried to search on google and also looked django-mongodb-engine library. But there is no solution.

Does django-mongodb-engine supports sorting? IS there any solution? Even any little suggestion would be helpful.

jatinkumar patel
  • 2,920
  • 21
  • 28

1 Answers1

0

This should answer you.

Answer is order_by. it can be used to sort for mongodb too.

Here are the docs

Community
  • 1
  • 1
Saurabh Goyal
  • 605
  • 4
  • 21
  • Thanks, But I need two level embedded field sorting like people = Person.objects.order_by('name__first_name') Which is not supported by django with *django-mongodb-engine* I am not using mongoengine – jatinkumar patel Sep 04 '15 at 18:39