Skip to content
Snippets Groups Projects
Commit 1332adf1 authored by syuilo's avatar syuilo
Browse files

Use index

parent 9bf19d46
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment