From the course: Databases for Node.js Developers
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Querying items with Mongoose - Node.js Tutorial
From the course: Databases for Node.js Developers
Querying items with Mongoose
- [Instructor] Before we start writing database queries, let's quickly take a look at how our shop page is rendered. So I opened the browser again with a sample application and when I click on shop, you see that we have a list of placeholder items there already, and you also see that we have text there and some add to basket functionality. So this is all there. So there has to be already some logic there that takes care of that, right? And if I now look into Visual Studio Code, I can first look into the views directory and in views, you will find the file shop.ejs. EJS is a template engine used with nodejs and it lets you basically use a JavaScript like syntax. And what this template does, it serves as a rendering template for our data. And when I scroll down, you see that we have here, starting in line 15, a list of text that we iterate over and further down, we also iterate over the items and when I go further down, somewhere there, yeah, you also see the pagination. So this is…
Contents
-
-
-
-
-
(Locked)
Managing product data with MongoDB33s
-
Setting up MongoDB with Docker2m 30s
-
(Locked)
Exploring MongoDB with Compass1m 19s
-
(Locked)
Introducing Mongoose2m 59s
-
(Locked)
Setting up Mongoose and connecting it to MongoDB10m 14s
-
(Locked)
Building a model for our products5m 25s
-
(Locked)
Integrating the model into our application3m 55s
-
(Locked)
Populating MongoDB with sample data2m 6s
-
(Locked)
Querying items with Mongoose9m 19s
-
(Locked)
Filtering items by tag4m 27s
-
(Locked)
Item administration: Listing and loading6m 32s
-
(Locked)
Item administration: Create, update, and delete15m 14s
-
(Locked)
Optimizing queries with indexes5m 33s
-
(Locked)
Performing text search in MongoDB5m 34s
-
(Locked)
-
-
-
-