Created
April 22, 2021 13:24
-
-
Save syamjayaraj/e4f4341e305d957b7ef37562e6c01f28 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
const mongoose = require("mongoose"); | |
let Schema = mongoose.Schema; | |
let postSchema = new Schema( | |
{ | |
title: { | |
type: String, | |
}, | |
description: { | |
type: String, | |
}, | |
author: { | |
type: String, | |
}, | |
}, | |
{ timestamps: true } | |
); | |
let Post = mongoose.model("post", postSchema); | |
module.exports = Post; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment