aboutsummaryrefslogtreecommitdiff
path: root/models/votes/vote.model.ts
blob: df2307efb68eecce3ab79da00fe5c4185bd5e8d3 (plain)
1
2
3
4
5
6
7
import { Model, model } from 'mongoose';
import { VoteSchema, voteSchema } from './vote.schema';

voteSchema.index({ pollId: 1, userId: 1 }, { unique: true }); // Unique together

export default model<VoteSchema, Model<VoteSchema>>('Vote', voteSchema);