summaryrefslogtreecommitdiff
path: root/src/api/endpoints/drive
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/drive
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/drive')
-rw-r--r--src/api/endpoints/drive/folders.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/endpoints/drive/folders.js b/src/api/endpoints/drive/folders.js
index fd37840ff7..f233de25a1 100644
--- a/src/api/endpoints/drive/folders.js
+++ b/src/api/endpoints/drive/folders.js
@@ -49,14 +49,14 @@ module.exports = (params, user, app) =>
// Construct query
const sort = {
- created_at: -1
+ _id: -1
};
const query = {
user_id: user._id,
parent_id: folder
};
if (since !== null) {
- sort.created_at = 1;
+ sort._id = 1;
query._id = {
$gt: new mongo.ObjectID(since)
};