Mongoose JS Tutorial - 5 - Build a CRUD App (3)

Published: 08 February 2016
on channel: JsWiz
22,916
153

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...


On this page of the site you can watch the video online Mongoose JS Tutorial - 5 - Build a CRUD App (3) with a duration of hours minute second in good quality, which was uploaded by the user JsWiz 08 February 2016, share the link with friends and acquaintances, this video has already been watched 22,916 times on youtube and it was liked by 153 viewers. Enjoy your viewing!