1. Installing MongoDB
To download MongoDB from the MongoDB official website, the version I downloaded is 64-bit 3.2.6. After download, install directly, my installation directory is D:\work\MongoDB.
2. Configuring MONGODB Environment variables
Add D:\work\MongoDB\Server\3.2\bin in Path. (Configure environment variables for more convenient execution of commands under bin)
3. Start MongoDB
When you start MongoDB, use the Mongod command,--dbpath set the path to the database,--logpath set the path to the log file
More parameters using the command Mongod Help can be viewed.
Attachment 1: Setting Mongod parameters with a configuration file
Create a new file mongodb.conf under D:\work\MongoDB and write it in a file
DBPath == D:\work\MongoDB\log\mongodb.log
Using commands
Mongod-f D:\work\MongoDB\mongodb.conf
Attachment 2: Start MongoDB as a service
Mongod--dbpath "D:\work\MongodDB\data"--logpath "D:\work\MongoDB\log\mongodb.log"--install--servicename "MongoDB"
Start MongoDB service: net start MongoDB
Stop MongoDB service: net stop MongoDB
MongoDB Quick Start Learning Note 1 Windows installation MongoDB