From b82eda5046119213e2a4adb8a46babd61bde50f8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 23 Jan 2017 14:53:46 +0900 Subject: [Server] Fix query performance --- src/api/endpoints/posts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/api/endpoints/posts.js') diff --git a/src/api/endpoints/posts.js b/src/api/endpoints/posts.js index 0428b400bc..9bc25315a7 100644 --- a/src/api/endpoints/posts.js +++ b/src/api/endpoints/posts.js @@ -38,11 +38,11 @@ module.exports = (params) => // Construct query const sort = { - created_at: -1 + _id: -1 }; const query = {}; if (since !== null) { - sort.created_at = 1; + sort._id = 1; query._id = { $gt: new mongo.ObjectID(since) }; -- cgit v1.3.1-freya