1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-13 22:28:58 +09:00

Use index

This commit is contained in:
syuilo 2018-04-03 01:37:43 +09:00
parent 9bf19d4676
commit 1332adf12b

View File

@ -5,12 +5,12 @@ import Reaction from './post-reaction';
import { pack as packUser } from './user';
const PostReaction = db.get<IPostReaction>('postReactions');
PostReaction.createIndex(['userId', 'postId'], { unique: true });
export default PostReaction;
export interface IPostReaction {
_id: mongo.ObjectID;
createdAt: Date;
deletedAt: Date;
postId: mongo.ObjectID;
userId: mongo.ObjectID;
reaction: string;