MongoDB Download
: https://www.mongodb.com/download-center#community
Install into the C packing directory
Create Data Catalog
MongoDB stores the data directory in the DB directory. However, this data directory is not actively created, and we need to create it after the installation is complete. Note that the data directory should be placed under the root directory (e.g. C: \ or D:\. , etc.).
In this tutorial, we have MongoDB installed on C Drive, now let's create a directory of data and create a DB directory in the data directory.
C:\>cd C:C:\>mkdir datac:\>cd datac:\data>mkdir DBC :\data>cd DBC:\data\db>
Run MongoDB server under command line
In order to run the MongoDB server from the command prompt, you must execute the Mongod.exe file from the bin directory of the MongoDB directory.
C:\mongodb\bin--dbpath C:\data\db
Connect to MongoDB
We can run the Mongo.exe command in the command window to connect to MongoDB and execute the following command:
C:\mongodb\bin\mongo. Exe
Configuring MongoDB Services
Creating a configuration file
Create a configuration file. The file must have the Systemlog.path parameter set, including some additional configuration options that are better.
For example, create a configuration file that is located in C:\mongodb\mongod.cfg, where Systemlog.path and Storage.dbpath are specified. The specific configuration is as follows:
Storage
Dbpath:c:\data\db
Net
bindip:127.0.0.1
port:12345
Systemlog:
Destination:file
Path:c:\data\log\mongod.log
Installing MongoDB Services
By executing Mongod.exe, using the--install option to install the service, use the--config option to specify the previously created configuration file.
"C:\mongodb\bin\mongod.exe"--"C:\mongodb\mongod.cfg"--Install
Start MongoDB Service
Mongodb
Close MongoDB Service
Mongodb
Windows Platform Installation MongoDB