question.model.ts 480 Bytes
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
2
3
4
import { model, Schema, Types } from "mongoose";

export interface IQuestion {
    type: string;
Jiwon Yoon's avatar
Jiwon Yoon committed
5
    // id: string;
Jiwon Yoon's avatar
Jiwon Yoon committed
6
7
8
9
10
11
12
    title?: string;
    isRequired: boolean;
    comment?: string;
    content?: any;
  }
  
  const schema = new Schema<IQuestion>({
Jiwon Yoon's avatar
Jiwon Yoon committed
13
    // id: {type:String},
Jiwon Yoon's avatar
Jiwon Yoon committed
14
15
16
17
18
19
20
21
22
    type:{type:String},
    title: {type:String},
    isRequired: {type:Boolean},
    comment:{type: String},
    content:{type: Object},
  });
  
  export default model<IQuestion>("Question", schema);