Sharkey/src/models/emoji.ts

21 lines
407 B
TypeScript
Raw Normal View History

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