2021-05-18 23:52:26 -07:00
|
|
|
const mongoose = require("mongoose");
|
2021-05-19 03:18:45 -07:00
|
|
|
|
2021-05-18 23:52:26 -07:00
|
|
|
const blogSchema = new mongoose.Schema({
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
require: true,
|
|
|
|
},
|
2021-05-19 23:44:03 -07:00
|
|
|
author: { required: true, type: String },
|
2021-05-18 23:52:26 -07:00
|
|
|
date: {
|
|
|
|
type: Date,
|
|
|
|
},
|
|
|
|
image: {
|
|
|
|
type: String,
|
|
|
|
default: "",
|
|
|
|
},
|
|
|
|
body: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
isBookMarked: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
module.exports = mongoose.model("Blog", blogSchema);
|