summaryrefslogtreecommitdiff
path: root/src/models/note-unread.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-09-19 14:18:34 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-09-19 14:18:34 +0900
commitd9f0e158a35eec183da77e84a3b038fab645bf62 (patch)
treea7cbad45883ff56d35771d849f95dbd911e3e45c /src/models/note-unread.ts
parent8.55.0 (diff)
downloadsharkey-d9f0e158a35eec183da77e84a3b038fab645bf62.tar.gz
sharkey-d9f0e158a35eec183da77e84a3b038fab645bf62.tar.bz2
sharkey-d9f0e158a35eec183da77e84a3b038fab645bf62.zip
Implement #2736
Diffstat (limited to 'src/models/note-unread.ts')
-rw-r--r--src/models/note-unread.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/models/note-unread.ts b/src/models/note-unread.ts
new file mode 100644
index 0000000000..62408d23b6
--- /dev/null
+++ b/src/models/note-unread.ts
@@ -0,0 +1,17 @@
+import * as mongo from 'mongodb';
+import db from '../db/mongodb';
+
+const NoteUnread = db.get<INoteUnread>('noteUnreads');
+NoteUnread.createIndex(['userId', 'noteId'], { unique: true });
+export default NoteUnread;
+
+export interface INoteUnread {
+ _id: mongo.ObjectID;
+ noteId: mongo.ObjectID;
+ userId: mongo.ObjectID;
+ isSpecified: boolean;
+
+ _note: {
+ userId: mongo.ObjectID;
+ };
+}