Commit c950832d authored by Lee Soobeom's avatar Lee Soobeom
Browse files

.

parent e7e56fda
import { model, Schema } from "mongoose"; import { model, Schema } from "mongoose";
export interface PostType { export interface PostType extends PostingType {
id: string; date?: string;
counts: number;
id?: string;
}
export interface PostingType {
title: string; title: string;
date: Date; text?: string;
body : string;
counts?: number;
theme: string; theme: string;
city: string; city: string;
} username: string;
}
const schema = new Schema<PostType>({ const schema = new Schema<PostType>({
id : {type: String}, id: { type: String },
title : { type: String }, title: { type: String },
date : {type: Date}, date: { type: Date },
body : {type : String}, text: { type: String },
counts : {type: Number}, counts: { type: Number },
theme : {type: String}, theme: { type: String },
city : {type: String}, city: { type: String },
username: { type: String },
}); });
export default model<PostType>("Post", schema); export default model<PostType>("Post", schema);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment