summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-01 09:29:44 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-01 09:29:44 +0900
commit2230360e7ea01b97b2a46a545500f7b582c3c768 (patch)
tree44c2a221f12be4a877474538b5d35f0d54aa85c8 /src
parent[Server] Remove needless query (diff)
downloadsharkey-2230360e7ea01b97b2a46a545500f7b582c3c768.tar.gz
sharkey-2230360e7ea01b97b2a46a545500f7b582c3c768.tar.bz2
sharkey-2230360e7ea01b97b2a46a545500f7b582c3c768.zip
[Server] Add 'hash' index to the drive_files collection
Diffstat (limited to 'src')
-rw-r--r--src/api/models/drive-file.ts6
1 files changed, 5 insertions, 1 deletions
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 (