Full Course: https://goo.gl/rT7o2k
Build a mini app using Express and Mongoose.
Learn How to us the find method to query for results.
– In the last video we learned a little bit Mongoose – including how to create Schemas and set up a connection.
– In this lecture we’ll start using mongoose along with express to query objects and display results.
– We’re going to be building a mini app for this project. So start by navigating into a folder where you want your app to be. We’ll start off with npm init to create a package.json file for us.
– Now we’ll install express, mongoose and body-parser
– Next, we’ll build out the BookSchema
– setup app.js and server + test server
– try connecting to mongoose for fail
– now connect to mongod
– Now lets add some books using our shell, connecting to our db and inserting them
– I want to fetch all the books using Express. So we’ll be using app.get in our app.js file to retrieve all the books we added as well as individual books.
– We’ll get into more detail on how to use express in later videos and I also have a free Express Fundamentals course that covers the basics you can check out.
Repo for the code: