diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-01-23 14:53:46 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-01-23 14:53:46 +0900 |
| commit | b82eda5046119213e2a4adb8a46babd61bde50f8 (patch) | |
| tree | e6f5170345af454fa486f786d369fbf3b2eb01ab /src/api/endpoints/messaging | |
| parent | [Client] Fix bug (diff) | |
| download | sharkey-b82eda5046119213e2a4adb8a46babd61bde50f8.tar.gz sharkey-b82eda5046119213e2a4adb8a46babd61bde50f8.tar.bz2 sharkey-b82eda5046119213e2a4adb8a46babd61bde50f8.zip | |
[Server] Fix query performance
Diffstat (limited to 'src/api/endpoints/messaging')
| -rw-r--r-- | src/api/endpoints/messaging/messages.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/endpoints/messaging/messages.js b/src/api/endpoints/messaging/messages.js index 9440e2b3aa..387ed3bea1 100644 --- a/src/api/endpoints/messaging/messages.js +++ b/src/api/endpoints/messaging/messages.js @@ -74,11 +74,11 @@ module.exports = (params, user) => }; const sort = { - created_at: -1 + _id: -1 }; if (since !== null) { - sort.created_at = 1; + sort._id = 1; query._id = { $gt: new mongo.ObjectID(since) }; |