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.
Populating MongoDB with sample data - Node.js Tutorial
From the course: Databases for Node.js Developers
Populating MongoDB with sample data
- [Instructor] To test the application and demonstrate queries, we need some data in our database. This is why we'll now populate MongoDB with sample data. We will load our sample data into the items collection using MongoDB Compass and I have it already open. So in simpleshop on items, I now click on Documents and they're on Add Data. And there I can now select input JSON or CSV file. So I click on that and the exercise files actually already contain a file for the sample data. So I'm now on my desktop and here I have the project folder. I click on it and here there is this folder sample-data. And there I have the sample-items chosen. I click on it and I click on Select. Then I click on Import. Now you see we imported 47 items. As I'm from Austria, I took the freedom to use AI to let it create just a set of somewhat typically Austrian products like the Mozartkugel or a Schnitzel, and Apfelstrudel. So you see it here. So each product has an id. This id is provided by MongoDB directly.…
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)
-
-
-
-