mirror of
https://example.com
synced 2024-11-24 23:36:38 +09:00
Use createIndex() instead of index() to avoid deprecation warnings
This commit is contained in:
parent
0d675e94f3
commit
7172ccd72c
4 changed files with 8 additions and 8 deletions
|
@ -2,7 +2,7 @@ import db from '../../db/mongodb';
|
|||
|
||||
const collection = db.get('access_tokens');
|
||||
|
||||
(collection as any).index('token'); // fuck type definition
|
||||
(collection as any).index('hash'); // fuck type definition
|
||||
(collection as any).createIndex('token'); // fuck type definition
|
||||
(collection as any).createIndex('hash'); // fuck type definition
|
||||
|
||||
export default collection as any; // fuck type definition
|
||||
|
|
|
@ -2,9 +2,9 @@ import db from '../../db/mongodb';
|
|||
|
||||
const collection = db.get('apps');
|
||||
|
||||
(collection as any).index('name_id'); // fuck type definition
|
||||
(collection as any).index('name_id_lower'); // fuck type definition
|
||||
(collection as any).index('secret'); // fuck type definition
|
||||
(collection as any).createIndex('name_id'); // fuck type definition
|
||||
(collection as any).createIndex('name_id_lower'); // fuck type definition
|
||||
(collection as any).createIndex('secret'); // fuck type definition
|
||||
|
||||
export default collection as any; // fuck type definition
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import db from '../../db/mongodb';
|
|||
|
||||
const collection = db.get('drive_files');
|
||||
|
||||
(collection as any).index('hash'); // fuck type definition
|
||||
(collection as any).createIndex('hash'); // fuck type definition
|
||||
|
||||
export default collection as any; // fuck type definition
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ import db from '../../db/mongodb';
|
|||
|
||||
const collection = db.get('users');
|
||||
|
||||
(collection as any).index('username'); // fuck type definition
|
||||
(collection as any).index('token'); // fuck type definition
|
||||
(collection as any).createIndex('username'); // fuck type definition
|
||||
(collection as any).createIndex('token'); // fuck type definition
|
||||
|
||||
export default collection as any; // fuck type definition
|
||||
|
||||
|
|
Loading…
Reference in a new issue