Created
January 30, 2019 00:55
-
-
Save THEozmic/7630e00bc13c0c0be1c43e5334606039 to your computer and use it in GitHub Desktop.
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
import mongoose from 'mongoose' | |
// Set Posts Schema | |
const schema = new mongoose.Schema({ | |
_id: mongoose.Schema.Types.ObjectId, | |
username: { | |
type: String, | |
required: [true, 'Username field is required'], | |
}, | |
profile_image: { | |
type: String, | |
required: [true, 'Profile Image field is required'], | |
}, | |
content: { | |
type: String, | |
required: [true, 'Content field is required'], | |
}, | |
}, { | |
timestamps: true | |
}), | |
Posts = mongoose.model('posts', schema) | |
export default Posts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment