mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-08 13:53:09 +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;
|
|
};
|