From cc4312b9ba108ef6e9fe96d0e0e4ed47949626e7 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 ca1a42b05..4b87b26a8 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 def519fad..427015769 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 = {