From b33e43cb006280c0a819d78ce9ee5fe9b2f195ba Mon Sep 17 00:00:00 2001 From: Socks Date: Thu, 5 Apr 2018 03:20:46 +0100 Subject: [PATCH] Sort tag search by time posted --- backend/timeline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/timeline.py b/backend/timeline.py index 1de6dcf..b062cd3 100644 --- a/backend/timeline.py +++ b/backend/timeline.py @@ -115,7 +115,7 @@ def get_mentions(username): def find_posts_by_hashtag(tag): - return timeline_db.find({'hashtags': tag}) + return timeline_db.find({'hashtags': tag}).sort('timePosted', pymongo.DESCENDING) def post_details(post_id):