Mongoose JS Tutorial - 5 - Build a CRUD App (3)
Full Course: https://goo.gl/rT7o2k Part 3 of Building a CRUD app Using Node.js, Mongoose and Express.js. Get Javascript Skills: http://jswiz.net This video will cover how to create new Books using the POST method. We'll be using Postman to demonstrate how to how to add a new Book to our model. So far we've looked at how to find All books and a single book from our collection. The first thing we need to do is add body-parser and set urlencoded to true and json capabilities. Let's start by creating a new Post route. There are 2 common ways to do this that you'll come across so we'll take a look at both. The first one, you'll ceate a variable assigned to an instance of your Schema. Then we'll specify exactly what should be passed. This is the more common method of POSTing items to your mongoose collection. And it helps in preventing errors that may occur when handling data between the front end and back end. Repo for the code: https://github.com/jakblak/MongooseJS-Essentials
Download
0 formatsNo download links available.