13
src/models/note-watching.ts
Normal file
13
src/models/note-watching.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as mongo from 'mongodb';
|
||||
import db from '../db/mongodb';
|
||||
|
||||
const NoteWatching = db.get<INoteWatching>('noteWatching');
|
||||
NoteWatching.createIndex(['userId', 'noteId'], { unique: true });
|
||||
export default NoteWatching;
|
||||
|
||||
export interface INoteWatching {
|
||||
_id: mongo.ObjectID;
|
||||
createdAt: Date;
|
||||
userId: mongo.ObjectID;
|
||||
noteId: mongo.ObjectID;
|
||||
}
|
||||
Reference in New Issue
Block a user