From 2e9bbf389e45488acd98d79d1bd606446d39ece7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 2 Nov 2018 12:08:28 +0900 Subject: [PATCH] Better index --- src/models/emoji.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/models/emoji.ts b/src/models/emoji.ts index f0d0b58273..888fcb4147 100644 --- a/src/models/emoji.ts +++ b/src/models/emoji.ts @@ -1,7 +1,8 @@ import db from '../db/mongodb'; const Emoji = db.get('emoji'); - +Emoji.createIndex('name'); +Emoji.createIndex('host'); Emoji.createIndex(['name', 'host'], { unique: true }); export default Emoji;