egirlskey/src/models/hashtag.ts

14 lines
345 B
TypeScript
Raw Normal View History

2018-07-17 22:19:24 +00:00
import * as mongo from 'mongodb';
import db from '../db/mongodb';
const Hashtag = db.get<IHashtags>('hashtags');
Hashtag.createIndex('tag', { unique: true });
Hashtag.createIndex('mentionedUserIdsCount');
export default Hashtag;
export interface IHashtags {
tag: string;
mentionedUserIds: mongo.ObjectID[];
mentionedUserIdsCount: number;
}