post.model.ts 478 Bytes
Newer Older
Kim, MinGyu's avatar
Kim, MinGyu committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { model, Schema } from "mongoose";

export interface PostType {
    id: string;
    title: string;
    date: Date;
    body : string;
    counts?: number;
    theme: string;
    city: string;
  }
  
const schema = new Schema<PostType>({
  id : {type: String},
  title : { type: String },
  date : {type: Date},
  body : {type : String},
  counts : {type: Number},
  theme : {type: String},
  city : {type: String},
  
});

export default model<PostType>("Post", schema);