26 lines
431 B
JavaScript
26 lines
431 B
JavaScript
const mongoose = require("mongoose");
|
|
|
|
const blogSchema = new mongoose.Schema({
|
|
title: {
|
|
type: String,
|
|
require: true,
|
|
},
|
|
author: { required: true, type: String },
|
|
date: {
|
|
type: Date,
|
|
},
|
|
image: {
|
|
type: Object,
|
|
default: "",
|
|
},
|
|
body: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
isBookMarked: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
});
|
|
module.exports = mongoose.model("Blog", blogSchema);
|