{"size": 415, "ext": "js", "max_stars_repo_path": "models/blog.js", "max_stars_repo_name": "dhruvil1808/Node-Practice", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "models/blog.js", "max_issues_repo_name": "dhruvil1808/Node-Practice", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "models/blog.js", "max_forks_repo_name": "dhruvil1808/Node-Practice", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.6666666667, "max_line_length": 79, "alphanum_fraction": 0.6698795181}
const mongoose = require("mongoose");
const schema = mongoose.Schema; //create a schema

const blogSchema = new schema( //creating a schema
  {
    title: { type: String, required: true },
    snippet: { type: String, required: true },
    body: { type: String, required: true },
  },
  { timestamps: true }
);

const Blog = mongoose.model("Blog", blogSchema); //creating a model with schema
module.exports = Blog;
