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

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