Created
September 24, 2019 19:09
-
-
Save donjosef/f98dad2e7844c5bbf3250643f0e0979a to your computer and use it in GitHub Desktop.
Create our Post monogoose model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
const Schema = mongoose.Schema; | |
const postSchema = new Schema({ | |
title: { | |
type: String, | |
required: true | |
}, | |
content: { | |
type: String, | |
required: true | |
}, | |
creator: { | |
type: Object, | |
required: true | |
} | |
}, {timestamps: true}); | |
module.exports = mongoose.model('Post', postSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment