const mongoose = require('mongoose'); const voteSchema = new mongoose.Schema({ poll: { type: mongoose.Schema.Types.ObjectId, ref: 'Poll' }, option: { type: mongoose.Schema.Types.ObjectId, ref: 'Option' }, voter: { type: mongoose.Schema.Types.ObjectId, ref: 'Voter' }, createdAt: { type: Date, default: Date.now } }); module.exports = mongoose.model('Vote', voteSchema);