Open In App

How to Install MongoDB for VSCode?

MongoDB is an open-source document-or

iented database, it is a very popular NoSQL database. This database does not store data in the form of tables. It is used to store large amount of data and allows you to work with large amount of data very efficiently. It provides official drivers for multiple languages like C, C#, .Net, Go, Java, Node.js, Perl, Ruby, Scala, Swift, etc. So using these drivers you are allowed to create applications in different languages. It uses JSON like format for storage, but it also has optional schemas this format is defined by BSON.       



Visual Studio Code or VS Code is a source code editor, it is available for Windows, macOS, and Linux operating systems. Or we can say that it is a text editor that supports development operations and version control systems, it also provides different tools to build hassle-free code. It is available with many useful extensions for languages like C++, C#, Java, Python, PHP, Go, etc., and runtimes like .NET and Unity. VS Code provides a great support with MongoDB database. Using MongoDB for VS Code extension, you are allowed to create and manage mongoDB databases from VS Code. In this article, we will see how to install and connect MongoDB with Vs Code. 

Installing MongoDB for VS Code

To install MongoDB for Visual studio Code follow the following steps:



Step 1: Open Visual Studio Code.

Step 2: Click the Extensions icon in the left navigation.

Step 3: Search MongoDB for VS Code in the extension.

Step 4: Click Install button on MongoDB for VS Code to install the extension.

Step 5: After installation, an icon will appear on the left sidebar. Now click on it.

Step 6: Now to connect to the MongoDB database click on add connection button.

Step 7: Click on Open form button in advanced connection settings. You are also allowed to use connection string. For connecting with connection string click on the Connect button in connect with connection string and paste the connection string to connect.

Step 8: Click on Connect button and you will connected to MongoDB. Here 27107 is the default port for a local MongoDB server. 

Note: Make sure before clicking on connect, MongoDB server (mongod.exe) must be running. 

Now MongoDB is ready to use in VS Code. You are now allowed to manage and create MongoDB databases, collections, and documents. 

Article Tags :