question.model.ts 493 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
13
14
15
16
17
    title?: string;
    isRequired: boolean;
    comment?: string;
    content?: any;
  }
  
  const schema = new Schema<IQuestion>({
    type:{type:String},
    title: {type:String},
    isRequired: {type:Boolean},
    comment:{type: String},
    content:{type: Object},
Jiwon Yoon's avatar
Jiwon Yoon committed
18
19
20
  }, {toJSON: {
    versionKey: false
  }});
Jiwon Yoon's avatar
Jiwon Yoon committed
21
22
23
  
  export default model<IQuestion>("Question", schema);