misskey/src/models/post-watching.ts
2018-04-06 23:32:38 +09:00

14 lines
348 B
TypeScript

import * as mongo from 'mongodb';
import db from '../db/mongodb';
const PostWatching = db.get<IPostWatching>('postWatching');
PostWatching.createIndex(['userId', 'postId'], { unique: true });
export default PostWatching;
export interface IPostWatching {
_id: mongo.ObjectID;
createdAt: Date;
userId: mongo.ObjectID;
postId: mongo.ObjectID;
}