Added posts and categories
This commit is contained in:
31
post.model.js
Normal file
31
post.model.js
Normal file
@@ -0,0 +1,31 @@
|
||||
const mongoose = require('mongoose');
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
// Database schema for an email message
|
||||
let Post = new Schema({
|
||||
title: {
|
||||
type: String
|
||||
},
|
||||
description: {
|
||||
type: String
|
||||
},
|
||||
author: {
|
||||
type: String
|
||||
},
|
||||
category: {
|
||||
type: Array
|
||||
},
|
||||
link: {
|
||||
type: String
|
||||
},
|
||||
date: {
|
||||
type: Date
|
||||
},
|
||||
photo: {
|
||||
type: String
|
||||
}
|
||||
}, {
|
||||
collection: 'posts'
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('Post', Post);
|
||||
Reference in New Issue
Block a user