From your question it looks like, you want to sort in ascending order:-
For that, you can use sort() function:-
db.foo.find().sort({x:1});
If you pass the 1 as a parameter then it will sort in ascending order and if you pass -1 then it will sort in descending order.