Skip to content

Instantly share code, notes, and snippets.

@donjosef donjosef/model.js
Created Sep 24, 2019

What would you like to do?
Create our Post monogoose model
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
You can’t perform that action at this time.