mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 19:03:08 +02:00
20 lines
407 B
TypeScript
20 lines
407 B
TypeScript
import * as mongo from 'mongodb';
|
|
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;
|
|
|
|
export type IEmoji = {
|
|
_id: mongo.ObjectID;
|
|
name: string;
|
|
host: string;
|
|
url: string;
|
|
aliases?: string[];
|
|
updatedAt?: Date;
|
|
/** AP object id */
|
|
uri?: string;
|
|
};
|