import { Document, Schema, Types } from 'mongoose'; import { Vote } from 'which-types'; export interface VoteSchema extends Document, Omit { password: string; } export const voteSchema = new Schema({ userId: { type: Types.ObjectId, ref: 'user' }, pollId: { type: Types.ObjectId, ref: 'poll' }, which: { type: String, enum: ['left', 'right'] } }, { timestamps: true });