Add index

This commit is contained in:
syuilo 2018-05-13 03:13:55 +09:00
parent 1836dd7312
commit bc197bc958
1 changed files with 1 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import User from './user';
import DriveFileThumbnail, { deleteDriveFileThumbnail } from './drive-file-thumbnail'; import DriveFileThumbnail, { deleteDriveFileThumbnail } from './drive-file-thumbnail';
const DriveFile = monkDb.get<IDriveFile>('driveFiles.files'); const DriveFile = monkDb.get<IDriveFile>('driveFiles.files');
DriveFile.createIndex('md5');
DriveFile.createIndex('metadata.uri', { sparse: true, unique: true }); DriveFile.createIndex('metadata.uri', { sparse: true, unique: true });
export default DriveFile; export default DriveFile;