I want implement a \"bump\" feature for topics. Once a topic is bumped, it will have a new \"bump_date\" field. I want to sort it so that when there is a \"bump_date\" fie
Sorting in MongoDB is done like so:
db.collection.find({ ... spec ... }).sort({ key: 1 })
where 1 is ascending and -1 is descending.
In your specific example: db.topics.find().sort({ bump_date: 1 }), although it might be better to call it something like "updated_at".
You'll also definitely want to put an index on your "bump_date" field.