Sort numbers as numbers
Numbers are sorted like strings, i.e. 10.0 comes before 2.0...
So, when sorting, check if all values seem to be numbers (or blanks), and then sort the number way.
As mentioned in the comments, MongoChef currently follows the sort order of MongoDB here. For now, we will not change this but will continue to monitor votes for this ticket and may revise in the future
-
Thomas (3T) commented
That's right. As @Matthew pointed out, MongoChef follows MongoDBs sort oder:
https://docs.mongodb.org/manual/reference/method/cursor.sort/ -
Matthew commented
MongoDB does not sort numbers that way. When sorting based on fields that are doubles, 2.0 will indeed sort before 10.0. Check to make sure you are not accidentally storing doubles as strings, and that you are sorting ascending, not descending.