Better index

This commit is contained in:
syuilo 2018-11-02 12:08:28 +09:00
parent 80b5fda292
commit 2e9bbf389e
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -1,7 +1,8 @@
import db from '../db/mongodb';
const Emoji = db.get<IEmoji>('emoji');
Emoji.createIndex('name');
Emoji.createIndex('host');
Emoji.createIndex(['name', 'host'], { unique: true });
export default Emoji;