From bca349fec1c71cda72bff00d485e55a8422a8573 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 13 Oct 2018 01:00:43 +0900 Subject: [PATCH] Improve performance --- src/models/drive-file.ts | 1 + src/models/drive-folder.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/models/drive-file.ts b/src/models/drive-file.ts index ca1a42b053..4b87b26a8c 100644 --- a/src/models/drive-file.ts +++ b/src/models/drive-file.ts @@ -11,6 +11,7 @@ import DriveFileThumbnail, { deleteDriveFileThumbnail } from './drive-file-thumb const DriveFile = monkDb.get('driveFiles.files'); DriveFile.createIndex('md5'); DriveFile.createIndex('metadata.uri'); +DriveFile.createIndex('metadata.userId'); export default DriveFile; export const DriveFileChunk = monkDb.get('driveFiles.chunks'); diff --git a/src/models/drive-folder.ts b/src/models/drive-folder.ts index def519fade..4270157694 100644 --- a/src/models/drive-folder.ts +++ b/src/models/drive-folder.ts @@ -4,6 +4,7 @@ import db from '../db/mongodb'; import DriveFile from './drive-file'; const DriveFolder = db.get('driveFolders'); +DriveFolder.createIndex('userId'); export default DriveFolder; export type IDriveFolder = {