Files
kno-logic-api/schema/post.model.js
2021-05-19 20:08:04 -04:00

31 lines
507 B
JavaScript

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);