MongoDB database tutorial, mongodb tutorial
1. Install MongoDB
Https://www.mongodb.com/download-center? Jmp = nav
Select a Stable version of the corresponding system for download (Current Stable Release)
2. After installation, you need to create a configuration because you do not know where the database created by the executable file exists.
1. create a folder named MongoDB in the specified place (this address is "D: \ work \ MongoDB"), which contains data (storing database files) and logs (logs), etc (parameter configuration information)
Note: The path must not contain Chinese characters.
2. Create a file named mongo. conf in etc and modify it as follows:
# Database path dbpath = D: \ work \ MongoDB \ data # log output file path logpath = D: \ work \ MongoDB \ logs \ mongo. log # The append mode is used for error logs. After this option is configured, mongodb logs are appended to existing log files instead of creating a new file logappend = true # enable log files, journal = true by default # This option can filter out useless log information. If debugging is required, set it to falsequiet = false # port 27017 = 27017 by default
3. Configure MongoDB Environment Variables
A. right-click the computer on the desktop and select Properties B. in the pop-up panel, select Advanced System settings c. select the advanced option in the pop-up box. The following is the environment variable button d. find the system environment variable, open path, and enter C: \ Program Files \ MongoDB \ Server \ 3.2 \ bin
4. After environment variables are configured, you can enter "mongo" in any directory"
Waiting for connections on port 27017 is displayed, indicating that the instance is successfully started,
Then, you can use the mongo command to perform a series of database operations.