Skip to content

Instantly share code, notes, and snippets.

Created December 20, 2012 21:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4348837 to your computer and use it in GitHub Desktop.
Save anonymous/4348837 to your computer and use it in GitHub Desktop.
natural sort is missing docs
db.interactions.find({kind: {$in: [1]}}).sort({$natural: -1}).hasNext()
false
> db.interactions.find({kind: {$in: [1]}}).sort({$natural: 1}).hasNext()
true
> db.interactions.find({kind: {$in: [1]}}).sort({$natural: -1}).count()
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment