Mongodb installation and configuration tutorial, doscommand, mongodbdos
Download: you can download it from the official website.
The default installation directory is (C: \ mongodb \)
Create a data directory
Create a data DIRECTORY And a log directory under the root directory. The data directory should be placed under the root directory (for example, C: \ data \ db and C: \ data \ log ).
Configure the MongoDB Service
Create a configuration file in C: \ mongodb \ mongod. cfg
SystemLog:
Destination: file
Path: c: \ data \ log \ mongod. log
Storage:
DbPath: c: \ data \ db
Install the MongoDB Service
Doscommand: "C: \ mongodb \ bin \ mongod.exe"-config "C: \ mongodb \ mongod. cfg"-install
Use mongodb
Doscommand:
Step 1: Enable MongoDB server C: \ mongodb \ bin \ mongod.exe or C: \ mongodb \ bin \ mongod-dbpath c: \ data \ db
Step 2: connect to mongodb C: \ mongodb \ bin \ cmd.exe
Step 3: db. runoob. insert ({x: 10 })
Step 4: db. runoob. find ()