Introduction
The NoSQL (Not Only SQL) database system MongoDB is well-known and frequently used. It was created to manage massive amounts of unstructured or semi-structured data. It was created by MongoDB Inc., and the company released the first stable version of it in 2010. Since MongoDB is categorized as a document-oriented database, it stores data in the flexible, schema-free BSON (Binary JSON) format.
Key Features of MongoDB
- Flexible data modelling
- Scalability
- High performance
- NoSQL architecture
- Replication and high availability
- Rich query language
Installation Process
Stepwise installation process along with Images are given below. Please follow each step carefully.
Step 1:
Download MongoDB Community Server from the MongoDB Download Center.
Note: There are two ways to install MongoDB: one uses msi and the other uses zip. Here, we'll go over the msi installation process for MongoDB.
You can choose any version, Windows, and package here based on your needs. For Windows, we must choose the following and click on download. (Note that the version and platform vary from device to device).
- Windows x64 platform;
- version: 6.0.8
- package: MSI
Step 2:
Click the next button on the startup screen after the msi file has been opened and the download is complete.
Step 3:
Click the next button once you have agreed to the terms and the License Agreement.
Step 4:
Now choose the complete option to install every functionality of the application. OR else use the Custom option if you simply want to install specific software features and want to choose the installation location.
Step 5:
Click next after selecting "Run service as Network Service user".
Step 6:
Click next after selecting install MongoDB Compass. For more information, Visit Compass MongoDB.
Step 7:
To begin the installation procedure, click the Install button.
Step 8:
Installation of MongoDB starts when you click the install button.
Step 10:
Now we go to the location where MongoDB installed in your system and copy the bin path. In my case this is the bin path - C:\Program Files\MongoDB\Server\6.0\bin
Step 11:
Now in order to create an environment variable open system properties -->Environment variable --> System variable --> select path and click edit --> then click new and paste the copied path link --> click ok.
Step 12:
To proceed, you'll need to download MongoDB Shell. Follow these steps:
- Open your web browser and visit the official MongoDB download page: MongoDB shell Download
- On the download page, you'll find various options for different platforms and versions.
- Choose the appropriate MongoDB Shell version that matches your operating system (32-bit or 64-bit).
- Select your platform (Windows, macOS, or Linux).
- Click the Zip package format.
- Click the "Download" button to initiate the download process.
- Your web browser will begin downloading the Zip file containing the MongoDB Shell.
Step 13:
Next Extract and replace the downloaded file in the MongoDB folder - C:\Program Files\MongoDB
Step 14:
Next, copy the bin path from the extract file's saved location.
Step 15:
Next in order to create an environment variable, open system properties -->Environment variable --> System variable --> select path and click edit --> then click the new option and paste the copied path link and finally click ok.
Step 16:
We can run the MongoDB server after configuring the environment variable. Run the following command after starting the command prompt. mongod.
Step 17 :
Now open C drive and create a folder called "data" inside of which another folder called "db" should be created.
After setting up these folders. Open the command prompt once more, and then execute the following command: mongod. Then, the MongoDB server will work successfully this time.
Step 18:
We will now link the mongo shell to our server (mongod). Type mongosh in a new Command Prompt to get started.
Things to consider:
- If you close the MongoDB window in the older versions of the software, your server will stop responding and won't be able to establish a connection with the Mongo shell. However, as this is the most recent version (6.0.8), do not be concerned. You can shut off and launch a new command prompt.
- In my situation, MongoDB began 127.0.0.1.on port 27017. You may now start creating queries in the Mongo Shell.
Shown below are few examples
- If you want to see databases use show dbs
- The Database_name command makes a new database in the system if a database does not exist in the system, if the database exists it uses that database: used test as an example.
- Additionally, the MongoDB compass tool is visible. You can connect to the MongoDB server via this tool by clicking the connect button in new connection.
- Finally you can see your databases and the data they contain in this tool.
Note: If you follow the above steps carefully, now you should have MongoDB in your device successfully.
























No comments:
Post a Comment