From 2230360e7ea01b97b2a46a545500f7b582c3c768 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 1 Feb 2017 09:29:44 +0900 Subject: [PATCH] [Server] Add 'hash' index to the drive_files collection --- src/api/models/drive-file.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/models/drive-file.ts b/src/api/models/drive-file.ts index b7b44c5722..4c7204b1f4 100644 --- a/src/api/models/drive-file.ts +++ b/src/api/models/drive-file.ts @@ -1,6 +1,10 @@ import db from '../../db/mongodb'; -export default db.get('drive_files') as any; // fuck type definition +const collection = db.get('drive_files'); + +(collection as any).index('hash'); // fuck type definition + +export default collection as any; // fuck type definition export function validateFileName(name: string): boolean { return (