mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-17 08:08:17 +09:00
20 lines
451 B
TypeScript
20 lines
451 B
TypeScript
import * as mongo from 'mongodb';
|
|
import db from '../db/mongodb';
|
|
|
|
const NoteUnread = db.get<INoteUnread>('noteUnreads');
|
|
NoteUnread.createIndex('userId');
|
|
NoteUnread.createIndex('noteId');
|
|
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;
|
|
};
|
|
}
|