In this article we will see ‘How to install Mongo DB in your System ?’. We know that Mongo DB is a NoSQL Database. It is becoming popular day by day because of its high performance, flexibility, scalability, reliability, distributed, schema-free architecture, easy replication support, simple API, support for big data etc. To know more about Mongo DB, follow our internal article. In this article we will concentrate only on setting the database up in your system. Let’s get into the topic ‘How to install Mongo DB in your System ?’
Table of Contents (Click on links below to navigate)
- 1 How to install/setup Mongo DB in your System ?
- 2 How to Download the MongoDB ?
- 3 How to install the MongoDB ?
- 4 How to set path in MongoDB ?
- 5 How to set folder for MongoDB ?
- 6 How to start MongoDB Client & Server ?
- 7 How to stop MongoDB Client & Server ?
- 8 How to work with MongoDB in Spring Boot Project?
How to install/setup Mongo DB in your System ?
In order to setup MongoDB in our system, we will follow a 6 step process as below.
1) Downloading MongoDB
2) Installing MongoDB
3) Setting Path of MongoDB
4) Setting folder for MongoDB
5) Starting MongoDB Server & Client
6) Stopping MongoDB Server & Client
How to Download the MongoDB ?
=>Select ‘MongoDB Community Server’
=>Select following from the dropdown
-> Platform eg. Windows
-> Package eg. MSI
=>Click on Download button
For Windows Platform, you will get a MSI file similar to ‘mongodb-win32-x86_64-2008plus-ssl-3.6.20-signed’
How to install the MongoDB ?
Double click on the downloaded file
Click on the Next > Next …..
Click on the Finish
How to set path in MongoDB ?
-> Copy Path till bin folder eg. C:\Program Files\MongoDB\Server\3.6\bin
-> Right click on MyComputer
-> Advanced System Settings
-> Click on Environment Variable
-> Choose Path
-> Click Edit Option
-> Paste Path and add Semicolon Symbol(;) at the end
-> OK(3 times)
How to set folder for MongoDB ?
-> Go to ‘C’ drive
-> Create a folder ‘data’
-> open folder data
-> Create a folder db
It should look like: ‘C:/data/db/’
How to start MongoDB Client & Server ?
Open command prompt (cmd)
To Start Mongo Server : type mongod
To Start Mongo Client : type mongo
How to stop MongoDB Client & Server ?
> press ctrl+C
How to work with MongoDB in Spring Boot Project?
Please visit internal link to get confidence on working with MongoDB in a Spring Boot Project.