Added poll create route in backend✔️

This commit is contained in:
Manik Maity
2024-11-08 20:27:06 +05:30
parent 9f689beb9d
commit 10425305dd
9 changed files with 237 additions and 16 deletions

View File

@@ -0,0 +1,29 @@
import mongoose, { Schema } from "mongoose";
const pollSchema = new Schema({
title : {
type : String,
required : true,
trim : true
},
description : {
type : String,
required : true,
trim : true
},
creatorId : {
type : Schema.Types.ObjectId,
ref : "User",
required : true
},
options : [
{
type : Object,
required : true,
}
]
}, {timestamps : true});
const PollModel = mongoose.model("Poll", pollSchema);
export default PollModel;