Add index

This commit is contained in:
syuilo 2018-04-06 23:32:38 +09:00
parent bcad552496
commit 716f3a4505

View File

@ -2,6 +2,7 @@ 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 {