blob: bf2dcf680e5b356338f19115a1eccc53905e9c90 (
plain)
1
2
3
4
5
6
7
|
import { Model, model } from 'mongoose';
import { VoteSchema, voteSchema } from './vote.schema';
voteSchema.index({ pollId: 1, authorId: 1 }, { unique: true }); // Unique together
export default model<VoteSchema, Model<VoteSchema>>('Vote', voteSchema);
|