aboutsummaryrefslogtreecommitdiff
path: root/models/votes/vote.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'models/votes/vote.model.ts')
-rw-r--r--models/votes/vote.model.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/votes/vote.model.ts b/models/votes/vote.model.ts
index df2307e..bf2dcf6 100644
--- a/models/votes/vote.model.ts
+++ b/models/votes/vote.model.ts
@@ -1,7 +1,7 @@
import { Model, model } from 'mongoose';
import { VoteSchema, voteSchema } from './vote.schema';
-voteSchema.index({ pollId: 1, userId: 1 }, { unique: true }); // Unique together
+voteSchema.index({ pollId: 1, authorId: 1 }, { unique: true }); // Unique together
export default model<VoteSchema, Model<VoteSchema>>('Vote', voteSchema);