Skip to content

Instantly share code, notes, and snippets.

@syamjayaraj

syamjayaraj/Post.js

Created Apr 22, 2021
Embed
What would you like to do?
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