mainimg.model.ts 512 Bytes
Newer Older
백승민's avatar
백승민 committed
1
import {model, Schema, Types } from "mongoose";
백승민's avatar
백승민 committed
2
3
4
5
6
7

export interface MainimgType {

    theme: string;
    city: string;
    title: string;
백승민's avatar
백승민 committed
8
    pic?: Types.ObjectId;
백승민's avatar
백승민 committed
9
10
11
12
13
14
15
16
17
18
19
20
21
}

const MainimgSchema = new Schema<MainimgType>({
    theme: {
        type: String,
    },
    city: {
        type: String,
    },
    title: {
        type: String,
        required: true,
    },
백승민's avatar
백승민 committed
22
23
24
25
    pic: {
        type : Schema.Types.ObjectId, 
        ref: "Avatar"
    }
백승민's avatar
백승민 committed
26
27
28
29
    
});

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