question.model.ts 474 Bytes
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { model, Schema, Types } from "mongoose";

export interface IQuestion {
    type: string;
    id: string;
    title?: string;
    isRequired: boolean;
    comment?: string;
    content?: any;
  }
  
  const schema = new Schema<IQuestion>({
    id: {type:String},
    type:{type:String},
    title: {type:String},
    isRequired: {type:Boolean},
    comment:{type: String},
    content:{type: Object},
  });
  
  export default model<IQuestion>("Question", schema);