Goal: You should be able to go to the compose page and add a new post which will be added to your database as a new document.
Verify by going into the mongo shell and find all posts.
Scroll down for a hint 👇
mongoose.connect("mongodb://localhost:27017/blogDB", {useNewUrlParser: true});
const postSchema = {
 title: String,
 content: String
};
const Post = mongoose.model("Post", postSchema);
 const post = new Post ({
   title: req.body.postTitle,
   content: req.body.postBody
 });
post.save()
0 comments