summaryrefslogtreecommitdiff
path: root/src/api/endpoints/posts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-01-23 14:53:46 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-01-23 14:53:46 +0900
commitb82eda5046119213e2a4adb8a46babd61bde50f8 (patch)
treee6f5170345af454fa486f786d369fbf3b2eb01ab /src/api/endpoints/posts
parent[Client] Fix bug (diff)
downloadsharkey-b82eda5046119213e2a4adb8a46babd61bde50f8.tar.gz
sharkey-b82eda5046119213e2a4adb8a46babd61bde50f8.tar.bz2
sharkey-b82eda5046119213e2a4adb8a46babd61bde50f8.zip
[Server] Fix query performance
Diffstat (limited to 'src/api/endpoints/posts')
-rw-r--r--src/api/endpoints/posts/reposts.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/endpoints/posts/reposts.js b/src/api/endpoints/posts/reposts.js
index a118ca6fba..ed97a601e3 100644
--- a/src/api/endpoints/posts/reposts.js
+++ b/src/api/endpoints/posts/reposts.js
@@ -55,13 +55,13 @@ module.exports = (params, user) =>
// Construct query
const sort = {
- created_at: -1
+ _id: -1
};
const query = {
repost_id: post._id
};
if (since !== null) {
- sort.created_at = 1;
+ sort._id = 1;
query._id = {
$gt: new mongo.ObjectID(since)
};