From the course: Next.js: Creating and Hosting a Full-Stack Site
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Adding data to MongoDB - React.js Tutorial
From the course: Next.js: Creating and Hosting a Full-Stack Site
Adding data to MongoDB
- [Instructor] All right, so at this point, we have this sort of half-finished connectToDb function. And before we finish it, what we're going to need to do is actually add some data into the Mongo Database that we just created. So here's how I recommend doing this, because it's much easier to do than interacting with the shell. What you're going to want to do is open up the extensions of either Visual Studio Code or GitHub Codespaces, and you're going to search for MongoDB for VS Code, all right? And it should be the top one right there. And what you're going to want to do is install it. And what this extension does is it gives you an easy way to interact with any Mongo Database by using what are called playgrounds. So here's what this is going to look like now. You're going to want to use the hotkey command Shift + P, and that'll open up the command palette for Visual Studio Code. And then we're going to search for MongoDB and we're going to want to say Connect with Connection…
Contents
-
-
-
-
-
(Locked)
What is MongoDB?1m 42s
-
(Locked)
Setting up hosting for MongoDB4m 54s
-
(Locked)
Adding MongoDB to Next.js6m 46s
-
(Locked)
Adding data to MongoDB7m 32s
-
(Locked)
Rewriting the list endpoints7m 29s
-
(Locked)
Rewriting the load product endpoint4m 2s
-
(Locked)
Rewriting the shopping cart endpoint5m 27s
-
(Locked)
Rewriting the add-to-cart endpoint5m 8s
-
(Locked)
Challenge: Rewriting the remove-from-cart endpoint57s
-
(Locked)
Solution: Rewriting the remove-from-cart endpoint4m 2s
-
(Locked)
-
-
-