Getting Started With MoneogDB | Install MongoDB In Hindi

📔 : MongoDB 🔗

इस topic में हम सीखेंगे कि MongoDB को कैसे install और connect करते हैं।

MongoDB को आप कई तरह से use कर सकते हैं। आप चाहें तो अपने system पर locally install करके या फिर cloud MongoDB भी use कर सकते हैं।

Install MongoDB on window

  1. सबसे पहले MongoDB का latest version download करें , MongoDB official website पर जाकर download section में जाए वहां से window platform को select करें।

  2. MongoDB की Windows installer को download करें "Community Server" edition को choose करें क्योंकि ये free है।

  3. Download होने के बाद installer को double-click करके run करें , Installer आपके system पर MongoDB को install करने के लिए सारी required files download कर देगा।

  4. installation setup करते time आप directory भी set कर सकते हैं जहाँ पर आपको install करना है बाकी आप default options के साथ installation complete कर सकते हैं।

  5. आप चाहें तो MongoDB Compass को भी install कर सकते हैं। यह एक graphical user interface (GUI) tool है जी MongoDB को manage करने में help करता है। जैसे MySQL databases के लिए MySQL workbench या SqlYog होता है बैसे ही ये है।

Install MongoDB on ubuntu

MongoDB को Ubuntu या Linux platform पर install करने के लिए नीचे दिते गए steps follow करें -

Add MongoDB Repository

Terminal को open करें और MongoDB की official repository को system में add करें।

sudo apt-get update sudo apt-get install gnupg wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
Add APT Repository

MongoDB की APT repository को add करने के लिए नीचे दी गयी command को run करे।

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -sc)/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
Install MongoDB

finally MongoDB को install करें।

sudo apt-get update sudo apt-get install -y mongodb-org
Start MongoDB Service

install करने के बाद use करने के लिए आपको इसकी service को start करना पड़ेगा।

sudo systemctl start mongod

बाकी MongoDB की service को same command के साथ stop , restart या status के लिए use का जाती है।

sudo systemctl stop mongod sudo systemctl restart mongod sudo systemctl status mongod

Cloud MongoDB

ऊपर दिखाए गए दोनों ही तरीके MongoDB को locally system पर download करने के लिए थे , हालाँकि अगर आप चाहें तो MongoDB Atlas को भी use कर सकते हैं।

MongoDB Atlas एक cloud service है जो आपको fully manageable MongoDB provide करती है , हालाँकि as a student इसे आप free में use कर सकते हैं।

  1. सबसे पहले MongoDB Atlas को official website पर जाकर register करके details को verify करें।

  2. Account create करने के बाद "Shared Cluster" पर जाकर एक cluster create करें और preferred cloud provider और region को set कर दें।

  3. By default, MongoDB Atlas में पूरी तरह external access disable रहता है , आप चाहें तो अपना IP Address set करें या फिर publically accessible रखने के लिए IP Address में 0.0.0.0 set कर दें।

  4. 3 - 4 minutes में cluster create हो जायगा फिर आप database पर click करके user add करें जिससे database के लिए username और password मिल जायगा।

  5. बाकी User add करते समय ही security के लिए आप अपना IP address set कर सकते हैं है या फिर एक से ज्यादा users को add करके उन्हें need के according read / write permissions दे सकते हैं।

  6. ये सब करने के बाद आपको connect का option दिखेगा , जहाँ से आपको MongoDB connect करने के options दिखेंगे जैसे , किसी programming language के driver के लिए connect करना है या फिर shell से , vs Code extension से या URI से। ये सभी options मिल जायेंगे।

Related Topics :

Rahul Kumar

Rahul Kumar

Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)

Get connected with me. :) LinkedIn Twitter Instagram Facebook

b2eprogrammers