कैसे डाउनलोड करें और इंस्टॉल करें MongoDB on Windows और बादल
⚡ स्मार्ट सारांश
डाउनलोड और इंस्टॉल कैसे करें MongoDB on Windows and Cloud is explained as a complete setup guide. This resource covers installing MongoDB सामुदायिक सर्वर चालू Windows, Javaलिखी हुई कहानी, Python, and Ruby drivers, MongoDB Compass, configuration with import and export, a config file, and deploying MongoDB Atlas on the cloud.

इसके लिए इंस्टॉलर MongoDB are available in both the 32-bit and 64-bit format. The 32-bit installers are good for development and test environments. But for production environments you should use the 64-bit installers. Otherwise, you can be limited in the amount of data that can be stored within MongoDB. It is advisable to always use the stable release for production environments.
कैसे डाउनलोड करें और इंस्टॉल करें MongoDB on Windows
डाउनलोड और इंस्टॉल करने के लिए निम्नलिखित चरणों का उपयोग किया जा सकता है MongoDB on Windows 10:
चरण 1) डाउनलोड करें MongoDB समुदाय सर्वर
इस पर जाएँ संपर्क और डाउनलोड करें MongoDB सामुदायिक सर्वर। हम इसके लिए 64-बिट संस्करण स्थापित करेंगे Windows.
चरण 2) सेटअप पर क्लिक करें
Once the download is complete, open the msi file. Click Next in the start-up screen.
चरण 3) अंतिम-उपयोगकर्ता लाइसेंस अनुबंध स्वीकार करें
- Accept the End-User License Agreement.
- अगला पर क्लिक करें।
Step 4) Click on the “Complete” button
Click on the “Complete” button to install all of the components. The custom option can be used to install selective components or if you want to change the location of the installation.
चरण 5) सेवा कॉन्फ़िगरेशन
- Select “Run service as Network Service user”. Make a note of the data directory; we will need this later.
- अगला पर क्लिक करें।
चरण 6) स्थापना प्रक्रिया शुरू करें
स्थापना शुरू करने के लिए इंस्टॉल बटन पर क्लिक करें।
Step 7) Click Next once completed
Installation begins. Click Next once completed.
चरण 8) फ़िनिश बटन पर क्लिक करें
Final step: once the installation is complete, click on the Finish button.
नमस्ते विश्व MongoDB: Javaस्क्रिप्ट ड्राइवर
ड्राइवर अंदर MongoDB are used for connectivity between client applications and the database. For example, if you had a Java कार्यक्रम और इसे कनेक्ट करने की आवश्यकता है MongoDB, then you would require to download and integrate the Java ड्राइवर ताकि प्रोग्राम के साथ काम कर सके MongoDB डेटाबेस।
इसके लिए ड्राइवर Javaलिपि बॉक्स से बाहर आता है। MongoDB shell which is used to work with the MongoDB database is actually a JavaScript shell. To access it:
चरण 1) Go to “C:\Program Files\MongoDB\Server\4.0\bin” पर क्लिक करें और mongo.exe पर डबल क्लिक करें। वैकल्पिक रूप से, आप पर भी क्लिक कर सकते हैं MongoDB desktop item.
चरण 2) Enter the following program into the shell:
var myMessage='Hello World'; printjson(myMessage);
Code स्पष्टीकरण:
- हम बस एक सरल घोषणा कर रहे हैं JavaScript variable to store a string called ‘Hello World’.
- हम वेरिएबल को स्क्रीन पर प्रिंट करने के लिए printjson विधि का उपयोग कर रहे हैं।
स्थापित करें Python चालक
चरण 1) सुनिश्चित करना Python is installed on the system.
चरण 2) Install the mongo related drivers by issuing the below command:
pip install pymongo
रूबी ड्राइवर स्थापित करें
चरण 1) Ensure Ruby is installed on the system.
चरण 2) Ensure gems is updated by issuing the command:
gem update --system
चरण 3) Install the mongo related drivers by issuing the below command:
gem install mongo
स्थापित करें MongoDB Compass - MongoDB प्रंबधन टूल
बाजार में ऐसे उपकरण उपलब्ध हैं जो प्रबंधन के लिए उपलब्ध हैं MongoDBऐसा ही एक गैर-वाणिज्यिक उपकरण है MongoDB Compass. Some of the features of Compass are given below:
- Full power of the Mongo shell
- अनेक गोले
- एकाधिक परिणाम
चरण 1) इस पर जाएँ संपर्क and click download.
चरण 2) Enter details in the popup and click submit.
चरण 3) Double click on the downloaded file.
चरण 4) Installation will auto-start.
चरण 5) Compass will launch with a Welcome screen.
चरण 6) Keep the privacy settings as default and click “Start Using Compass”.
चरण 7) You will see the home screen with a list of current databases.
MongoDB कॉन्फ़िगरेशन, आयात और निर्यात
शुरू करने से पहले MongoDB सर्वर, पहला महत्वपूर्ण पहलू डेटा निर्देशिका को कॉन्फ़िगर करना है जहां सभी MongoDB data will be stored. This can be done in the following way:
उपरोक्त कमांड 'md \data\db' आपके वर्तमान स्थान पर \data\db नामक एक निर्देशिका बनाता है। MongoDB इस स्थान पर स्वचालित रूप से डेटाबेस बनाएगा, क्योंकि यह डिफ़ॉल्ट स्थान है MongoDB इसकी जानकारी संग्रहीत करने के लिए। हम बस यह सुनिश्चित कर रहे हैं कि निर्देशिका मौजूद है, ताकि MongoDB जब यह शुरू हो जाए तो इसे ढूंढा जा सकता है।
डेटा का आयात MongoDB “mongoimport” कमांड का उपयोग करके किया जाता है। निम्न उदाहरण दिखाता है कि यह कैसे किया जा सकता है।
चरण 1) Create a CSV file called data.csv and put the following data in it:
Employeeid,EmployeeName 1,Guru99 2,Mohan 3,Smith
So in the above example, we are assuming we want to import 3 documents into a collection called data. The first row is called the header line, which will become the field names of the collection.
चरण 2) Issue the mongoimport command.
Code स्पष्टीकरण:
- We are specifying the db option to say which database the data should be imported to.
- The type option is to specify that we are importing a csv file.
- Remember that the first row is called the header line, which will become the field names of the collection; that is why we specify the –headerline option. And then we specify our data.csv file.
उत्पादन
आउटपुट से स्पष्ट रूप से पता चलता है कि 3 दस्तावेज़ आयात किए गए थे MongoDB.
निर्यात MongoDB is done by using the mongoexport command.
Code स्पष्टीकरण:
- हम db विकल्प निर्दिष्ट कर रहे हैं कि डेटा को किस डेटाबेस से निर्यात किया जाना चाहिए।
- We are specifying the collection option to say which collection to use.
- The third option is to specify that we want to export to a csv file.
- चौथा यह निर्दिष्ट करना है कि संग्रह के कौन से क्षेत्र निर्यात किए जाने चाहिए।
- –out विकल्प डेटा निर्यात करने के लिए csv फ़ाइल का नाम निर्दिष्ट करता है।
उत्पादन
आउटपुट से स्पष्ट रूप से पता चलता है कि 3 रिकॉर्ड निर्यात किए गए थे MongoDB.
का विन्यास MongoDB कॉन्फ़िगरेशन फ़ाइल वाला सर्वर
One can configure the mongod server instance to start up with a configuration file. The configuration file contains settings that are equivalent to the mongod command-line options. For example, suppose you wanted MongoDB to store all its logging information to a custom location, then follow the below steps:
चरण 1) Create a file called “mongod.conf” and store the below information in the file.
- The first line of the file specifies that we want to add configuration for the system log file, that is where the information about what the server is doing goes, in a custom log file.
- दूसरा विकल्प यह है कि स्थान एक फ़ाइल होगा।
- This mentions the location of the log file.
- logAppend: “true” का मतलब यह सुनिश्चित करना है कि लॉग जानकारी लॉग फ़ाइल में जुड़ती रहे। यदि आप मान “false” रखते हैं, तो फ़ाइल हटा दी जाएगी और जब भी सर्वर फिर से शुरू होगा, तो उसे नए सिरे से बनाया जाएगा।
चरण 2) Start the mongod server process and specify the above created configuration file as a parameter. The screenshot of how this can be done is shown below.
Once the above command is executed, the server process will start using this configuration file, and if you go to the /etc directory on your system, you will see the mongod.log file created. The below snapshot shows an example of what a log file would look like.
कैसे स्थापित करने के लिए MongoDB क्लाउड पर (AWS, गूगल, Azure)
You do not need to install the MongoDB server and configure it. You can deploy a MongoDB Atlas server on the cloud on platforms like AWS, गूगल Cloud, and Azure, and connect to the instance using a client. Below are the detailed steps:
चरण 1) इस पर जाएँ संपर्क.
- व्यक्तिगत विवरण दर्ज करें
- शर्तों से सहमत हैं
- Click the button “Get Started Free”
चरण 2) Click “Build my first cluster”.
चरण 3) आप इनमें से चयन कर सकते हैं एडब्ल्यूएसगूगल क्लाउड और Azure as your cloud provider. In this tutorial, we will use AWS, which is set by default. Make no other changes on the page and click “Create Cluster".
चरण 4) Cluster creation takes some time.
चरण 5) After some time you will see the cluster ready.
चरण 6) Click Security > Add new user.
चरण 7) अगली स्क्रीन पर:
- उपयोगकर्ता क्रेडेंशियल दर्ज करें
- विशेषाधिकार निर्दिष्ट करें
- Click the Add User button
चरण 8) In the dashboard, click the connect button.
- अपने IP कनेक्शन को श्वेतसूची में डालें
- कनेक्शन विधि चुनें
चरण 9) Select the connection method of your choice to connect to the MongoDB सर्वर.


































