Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Descending sort '-_id' is not working [mongodb 2.6.11] #55

Open
yousaf-harry opened this issue Apr 15, 2016 · 2 comments
Open

Descending sort '-_id' is not working [mongodb 2.6.11] #55

yousaf-harry opened this issue Apr 15, 2016 · 2 comments

Comments

@yousaf-harry
Copy link

I came across a strange issue; sorting on id field with '-' is not working and does not return anything where as without '-' is working fine.

This does not work query_set.order_by('-_id')
where as this is working query_set.order_by('_id')

@yousaf-harry
Copy link
Author

I have monogdb 2.6.7 on my local machine and both of the above conditions work there. Where as on my CentOS server I have mongodb 2.6.11 and it fails on it.

@last-partizan
Copy link
Contributor

Probably that issue related to mongodb version. I can not reproduce it with v3.2.3

You can check mongodb query log and compare executed db.find(..) commands.

@last-partizan last-partizan changed the title Descending sort '-_id' is not working Descending sort '-_id' is not working [mongodb 2.6.11] Apr 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants