mainimg.model.ts 460 Bytes
Newer Older
Kim, MinGyu's avatar
Kim, MinGyu committed
1
import { model, Schema, Types } from "mongoose";
백승민's avatar
백승민 committed
2
3

export interface MainimgType {
Kim, MinGyu's avatar
Kim, MinGyu committed
4
5
6
  theme: string;
  city: string;
  title: string;
Kim, MinGyu's avatar
Kim, MinGyu committed
7
  fileInfo?: Types.ObjectId;
백승민's avatar
백승민 committed
8
9
10
}

const MainimgSchema = new Schema<MainimgType>({
Kim, MinGyu's avatar
Kim, MinGyu committed
11
12
13
14
15
16
17
18
19
20
  theme: {
    type: String,
  },
  city: {
    type: String,
  },
  title: {
    type: String,
    required: true,
  },
Kim, MinGyu's avatar
Kim, MinGyu committed
21
  fileInfo: { type: Schema.Types.ObjectId, ref: "Fileinfo" },
백승민's avatar
백승민 committed
22
23
24
});

export default model<MainimgType>("Mainimg", MainimgSchema);