Agromind-backend / backend /models /post.model.js
gh-action-hf-auto
auto: sync backend from github@32fb9685
8a6248c
import mongoose from 'mongoose'
const postSchema = new mongoose.Schema({
title:{
type: String,
required: true,
},
content: {
type: String,
required: true,
},
author: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true,
},
createdAt: {
type: Date,
default: Date.now,
},
});
export default mongoose.model('Post', postSchema);