sharkey/src/models/emoji.ts

19 lines
371 B
TypeScript
Raw Normal View History

2018-11-04 03:18:32 +09:00
import * as mongo from 'mongodb';
import db from '../db/mongodb';
const Emoji = db.get<IEmoji>('emoji');
2018-11-02 12:08:28 +09:00
Emoji.createIndex('name');
Emoji.createIndex('host');
Emoji.createIndex(['name', 'host'], { unique: true });
export default Emoji;
export type IEmoji = {
2018-11-04 03:18:32 +09:00
_id: mongo.ObjectID;
name: string;
host: string;
url: string;
aliases?: string[];
updatedAt?: Date;
};