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.

Fetching item information for the basket

Fetching item information for the basket - Node.js Tutorial

From the course: Databases for Node.js Developers

Fetching item information for the basket

- [Instructor] So far we built the foundation of our basket system using Redis to store basket data. However, if we look at the basket page, now we only see the sku and the quantity. To make the basket useful, we need more details about the items like the name and the price. But this information is stored in MongoDB, not Redis, and this is where things get interesting. We now need to combine data from multiple sources so we get the basket content from Redis, but the product details from MongoDB. By fetching item details from MongoDB and merging them with basket data from Redis, we of course make the whole system way more useful and it also shows us a few more advanced concepts about dealing with different data sources and we will do this now. So I head back into Visual Studio Code and let's first look into Views and in Views, let's look into basket.ejs. Because there you see that we are iterating over the items array and then we want to output the sku to name the price and the…

Contents