1. Installing MongoDB
MongoDB installation is very simple, just need to extract the downloaded MongoDB compressed files to any directory, and add the bin directory to the system's path environment variable can be
2. Start MongoDB
Before you start MongoDB, manually create a directory that holds the MongoDB data files, such as D:\mongo_data
Execute Mongod--dbpath=d:\mongo_data at the command line
tip : Manually create a file with the suffix of bat, file name arbitrary, the content is: Mongod--dbpath=d:\mongo_data, double-click this file to start the MongoDB service, not every time to the command line to execute the start command
You can type ctrl-c to completely stop Mongod running under the shell that starts the server
You can also use the command to install MongoDB as a service:
D:\mongodb\bin\mongod.exe--logpath D:\mongo_log\mongodb.log--logappend--dbpath D:\mongo_data--directoryperdb-- ServiceName MongoDB--install
Remove this service from System services: D:\mongodb\bin\mongod.exe--logpath D:\mongo_log\mongodb.log--logappend--dbpath D:\mongo_data-- Directoryperdb--servicename MongoDB--remove
3. Connect to a MongoDB server
On the command line, you can use the MONGO command to connect to the MongoDB server, as follows, enter the MONGO command to connect to the local database named Test by default, and if you want to connect to a remote database, you can use MONGO Ip:port
MongoDB Environment Preparation