diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-09-19 14:18:34 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-09-19 14:18:34 +0900 |
| commit | d9f0e158a35eec183da77e84a3b038fab645bf62 (patch) | |
| tree | a7cbad45883ff56d35771d849f95dbd911e3e45c /src/models/note-unread.ts | |
| parent | 8.55.0 (diff) | |
| download | sharkey-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.ts | 17 |
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; + }; +} |