Nasıl İndirilir ve Kurulur MongoDB on Windows ve Bulut
⚡ Akıllı Özet
İndirme ve Yükleme MongoDB on Windows and Cloud is explained as a complete setup guide. This resource covers installing MongoDB Community Server on Windows, JavaSenaryo, Python, and Ruby drivers, MongoDB Compass, configuration with import and export, a config file, and deploying MongoDB Atlas on the cloud.

Kurulumcular 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.
Nasıl İndirilir ve Kurulur MongoDB on Windows
İndirme ve yükleme için aşağıdaki adımlar kullanılabilir MongoDB on Windows 10:
Adım 1) İndir MongoDB Community Server
Git Link ve indirme MongoDB Topluluk Sunucusu. 64 bit sürümünü yükleyeceğiz Windows.
Adım 2) Kurulum'a tıklayın
Once the download is complete, open the msi file. Click Next in the start-up screen.
Adım 3) Son Kullanıcı Lisans Sözleşmesini Kabul Edin
- Son Kullanıcı Lisans Sözleşmesini kabul edin.
- Sonrakine tıkla.
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.
Adım 5) Hizmet Yapılandırması
- Select “Run service as Network Service user”. Make a note of the data directory; we will need this later.
- Sonrakine tıkla.
Adım 6) Kurulum işlemini başlatın
Kurulumu başlatmak için Install butonuna tıklayın.
Step 7) Click Next once completed
Installation begins. Click Next once completed.
Adım 8) Bitir butonuna tıklayın
Final step: once the installation is complete, click on the Finish button.
Merhaba Dünya MongoDB: JavaKomut Dosyası Sürücüsü
Sürücüler MongoDB are used for connectivity between client applications and the database. For example, if you had a Java programa bağlanmak için gerekliydi MongoDB, then you would require to download and integrate the Java Programın çalışabilmesi için sürücü MongoDB veri tabanı.
için sürücü JavaSenaryo kutudan çıkar. MongoDB shell which is used to work with the MongoDB veritabanı aslında bir JavaScript shell. To access it:
) 1 Adım Go to “C:\Program Files\MongoDB\Server\4.0\bin” ve mongo.exe dosyasına çift tıklayın. Alternatif olarak, ayrıca MongoDB desktop item.
) 2 Adım Enter the following program into the shell:
var myMessage='Hello World'; printjson(myMessage);
Code Açıklama:
- Biz sadece basit bir açıklama yapıyoruz JavaScript variable to store a string called ‘Hello World’.
- Değişkeni ekrana yazdırmak için printjson yöntemini kullanıyoruz.
kurmak Python Sürücü
) 1 Adım Sağlamak Python is installed on the system.
) 2 Adım Install the mongo related drivers by issuing the below command:
pip install pymongo
Ruby Sürücüsünü Yükle
) 1 Adım Ensure Ruby is installed on the system.
) 2 Adım Ensure gems is updated by issuing the command:
gem update --system
) 3 Adım Install the mongo related drivers by issuing the below command:
gem install mongo
kurmak MongoDB Compass - MongoDB Yönetim aracı
Piyasada yönetmek için kullanılabilecek araçlar var MongoDB. Ticari olmayan bu araçlardan biri MongoDB Compass. Some of the features of Compass are given below:
- Full power of the Mongo shell
- Çoklu kabuklar
- Çoklu sonuçlar
) 1 Adım Git Link ve indir'i tıklayın.
) 2 Adım Enter details in the popup and click submit.
) 3 Adım Double click on the downloaded file.
) 4 Adım Installation will auto-start.
) 5 Adım Compass will launch with a Welcome screen.
) 6 Adım Keep the privacy settings as default and click “Start Using Compass”.
) 7 Adım You will see the home screen with a list of current databases.
MongoDB Yapılandırma, İçe Aktarma ve Dışa Aktarma
Başlamadan önce MongoDB sunucusunda ilk önemli husus, tüm sunucuların bulunduğu veri dizinini yapılandırmaktır. MongoDB data will be stored. This can be done in the following way:
Yukarıdaki 'md \data\db' komutu, geçerli konumunuzda \data\db adında bir dizin oluşturur. MongoDB veritabanlarını otomatik olarak bu konumda oluşturacaktır, çünkü burası varsayılan konumdur. MongoDB bilgilerini saklamak için. Biz sadece dizinin mevcut olduğundan emin oluyoruz, böylece MongoDB başladığında bulabilirsiniz.
Verilerin içe aktarılması MongoDB "mongoimport" komutu kullanılarak yapılır. Aşağıdaki örnek bunun nasıl yapılabileceğini gösterir.
) 1 Adım 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 Adım Issue the mongoimport command.
Code Açıklama:
- 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.
Çıktı
Çıktı açıkça 3 belgenin içe aktarıldığını gösteriyor MongoDB.
İhracat MongoDB is done by using the mongoexport command.
Code Açıklama:
- Verilerin hangi veritabanından aktarılması gerektiğini söylemek için db seçeneğini belirtiyoruz.
- 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.
- Dördüncüsü, koleksiyonun hangi alanlarının dışa aktarılması gerektiğini belirtmektir.
- –out seçeneği, verilerin dışa aktarılacağı csv dosyasının adını belirtir.
Çıktı
Çıktı açıkça 3 kaydın dışa aktarıldığını gösteriyor MongoDB.
yapılandırma MongoDB yapılandırma dosyası içeren sunucu
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 Adım 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.
- İkinci seçenek ise konumun bir dosya olacağını belirtmektir.
- This mentions the location of the log file.
- logAppend: “true”, günlük bilgilerinin günlük dosyasına eklenmeye devam etmesini sağlamak anlamına gelir. Değeri “yanlış” olarak belirlerseniz, sunucu yeniden başlatıldığında dosya silinir ve yeni oluşturulur.
) 2 Adım 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.
Nasıl Kurulur MongoDB Bulut üzerinde (AWS, Google, Azure)
You do not need to install the MongoDB server and configure it. You can deploy a MongoDB AWS gibi platformlarda bulutta yer alan Atlas sunucusu, Google Cloud, ve Azure, and connect to the instance using a client. Below are the detailed steps:
) 1 Adım Git Link.
- Kişisel Ayrıntıları Girin
- koşulları kabul ediyor musunuz
- Click the button “Get Started Free”
) 2 Adım Click “Build my first cluster”.
) 3 Adım Arasında seçim yapabilirsiniz AWS, Google Cloud, ve 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 anlayışının sonucu olarak, buzdolabında iki üç günden fazla durmayan küçük şişeler elinizin altında bulunur.
) 4 Adım Cluster creation takes some time.
) 5 Adım After some time you will see the cluster ready.
) 6 Adım Click Security > Add new user.
) 7 Adım Sonraki ekranda:
- Kullanıcı kimlik bilgilerini girin
- Ayrıcalıklar atayın
- Kullanıcı Ekle düğmesini tıklayın
) 8 Adım In the dashboard, click the connect button.
- IP bağlantınızı beyaz listeye alın
- Bağlantı yöntemini seçin
) 9 Adım Select the connection method of your choice to connect to the MongoDB sunucusu.


































