diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-02-01 09:29:44 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-02-01 09:29:44 +0900 |
| commit | 2230360e7ea01b97b2a46a545500f7b582c3c768 (patch) | |
| tree | 44c2a221f12be4a877474538b5d35f0d54aa85c8 /src | |
| parent | [Server] Remove needless query (diff) | |
| download | sharkey-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.ts | 6 |
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 ( |