Skip to content

Instantly share code, notes, and snippets.

@syamjayaraj
Created April 22, 2021 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syamjayaraj/e4f4341e305d957b7ef37562e6c01f28 to your computer and use it in GitHub Desktop.
Save syamjayaraj/e4f4341e305d957b7ef37562e6c01f28 to your computer and use it in GitHub Desktop.
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