mainimg.model.ts 448 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
7
  theme: string;
  city: string;
  title: string;
  pic?: 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
21
  theme: {
    type: String,
  },
  city: {
    type: String,
  },
  title: {
    type: String,
    required: true,
  },
  pic: { type: Schema.Types.ObjectId, ref: "Avatar" },
백승민's avatar
백승민 committed
22
23
24
});

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