Improve performance

This commit is contained in:
syuilo 2018-10-13 01:00:43 +09:00
parent 713ce1f980
commit cc4312b9ba
2 changed files with 2 additions and 0 deletions

View file

@ -11,6 +11,7 @@ import DriveFileThumbnail, { deleteDriveFileThumbnail } from './drive-file-thumb
const DriveFile = monkDb.get<IDriveFile>('driveFiles.files');
DriveFile.createIndex('md5');
DriveFile.createIndex('metadata.uri');
DriveFile.createIndex('metadata.userId');
export default DriveFile;
export const DriveFileChunk = monkDb.get('driveFiles.chunks');

View file

@ -4,6 +4,7 @@ import db from '../db/mongodb';
import DriveFile from './drive-file';
const DriveFolder = db.get<IDriveFolder>('driveFolders');
DriveFolder.createIndex('userId');
export default DriveFolder;
export type IDriveFolder = {