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

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