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

Veröffentlicht am: 08 Februar 2016
auf dem Kanal: 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...


Auf dieser Seite können Sie das Online-Video Mongoose JS Tutorial - 5 - Build a CRUD App (3) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer JsWiz 08 Februar 2016 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 22,916 Mal angesehen und es wurde von 153 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!