어떤 말을 적어야할지 기억이 안나신다구요? 기억무새
가 대신 써드릴게요! 🎵
User
import mongoose from 'mongoose';
import { IUser } from "../interfaces/IUser"
const UserSchema = new mongoose.Schema({
name: {
type: String,
required: true,
unique: true
},
img: {
type: String,
required: true
},
})
export default mongoose.model<IUser & mongoose.Document>("User", UserSchema);
Comment
import mongoose from 'mongoose';
import { IComment } from "../interfaces/IComment"
const CommentSchema = new mongoose.Schema({
division: {
type: String,
required: true
},
category: {
type: String,
required: true
},
sentence: {
type: String,
required: true,
unique: true
}
})
export default mongoose.model<IComment & mongoose.Document>("Comment", CommentSchema);