Cantilever-Labs/models/Blog.js

26 lines
431 B
JavaScript
Raw Normal View History

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: {
2021-05-26 03:05:16 -07:00
type: Object,
2021-05-18 23:52:26 -07:00
default: "",
},
body: {
type: String,
required: true,
},
isBookMarked: {
type: Boolean,
default: false,
},
});
module.exports = mongoose.model("Blog", blogSchema);