2018-11-03 13:18:32 -05:00
|
|
|
import * as mongo from 'mongodb';
|
2018-11-01 18:59:40 -05:00
|
|
|
import db from '../db/mongodb';
|
|
|
|
|
|
|
|
const Emoji = db.get<IEmoji>('emoji');
|
2018-11-01 22:08:28 -05:00
|
|
|
Emoji.createIndex('name');
|
|
|
|
Emoji.createIndex('host');
|
2018-11-01 18:59:40 -05:00
|
|
|
Emoji.createIndex(['name', 'host'], { unique: true });
|
|
|
|
|
|
|
|
export default Emoji;
|
|
|
|
|
|
|
|
export type IEmoji = {
|
2018-11-03 13:18:32 -05:00
|
|
|
_id: mongo.ObjectID;
|
2018-11-01 18:59:40 -05:00
|
|
|
name: string;
|
|
|
|
host: string;
|
|
|
|
url: string;
|
|
|
|
aliases?: string[];
|
|
|
|
updatedAt?: Date;
|
2018-12-19 06:19:43 -06:00
|
|
|
/** AP object id */
|
|
|
|
uri?: string;
|
2018-11-01 18:59:40 -05:00
|
|
|
};
|