summaryrefslogtreecommitdiff
path: root/src/models
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-07-18 07:19:24 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-07-18 07:19:24 +0900
commitdf20f5063dd5f93235307e5fca6fc7b17625bea9 (patch)
tree4adfc17a5ea5794e4d70fe1fe6fbc40812277e3d /src/models
parent:v: (diff)
downloadsharkey-df20f5063dd5f93235307e5fca6fc7b17625bea9.tar.gz
sharkey-df20f5063dd5f93235307e5fca6fc7b17625bea9.tar.bz2
sharkey-df20f5063dd5f93235307e5fca6fc7b17625bea9.zip
#1720 #59
Diffstat (limited to 'src/models')
-rw-r--r--src/models/hashtag.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/models/hashtag.ts b/src/models/hashtag.ts
new file mode 100644
index 0000000000..f5b6156055
--- /dev/null
+++ b/src/models/hashtag.ts
@@ -0,0 +1,13 @@
+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;
+}