Currently the latest version of MONGO is 4.0 (2018-07-18),
Https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.0-signed.msi
Software InstallationThis installation step takes about 20 minutes in this installation, at which point you can add the bin directory to the environment variable by adding the environment variable D:\data\MongoDB\Server\4.0\bin to the path, and then the next step, until the last connection, to temporarily close the window. This installation does not specifically specify the data directory with the log directory, which defaults to the data directory D:\data\MongoDB\Server\4.0\data log directory D:\data\MongoDB\Server\4.0\log
Mongod starting the database
Mongod--dbpath "" Specifies the data directory when the database is started and does not specify when the data directory defaults to the installation letter: \data\db
Background boot
Start/b Mongod
Start the sample
MD "D:\DATA\MONGODB\SERVER\4.0\DATA\DB"
Mongod--dbpath "D:\data\MongoDB\Server\4.0\data\db"
Connecting to a database
PS d:\users\administrator> MONGO
MongoDB Shell version v4.0.0
Connecting to:mongodb://127.0.0.1:27017
MongoDB Server version:4.0.0
Server has startup warnings:
2018-07-18t23:36:39.472+0800 I CONTROL [Initandlisten]
2018-07-18t23:36:39.472+0800 I control [Initandlisten] * * warning:access CONTROL is not enabled for the database.
2018-07-18t23:36:39.472+0800 I CONTROL [initandlisten] * * Read and Write access to data and configuration is unrestricted.
2018-07-18t23:36:39.472+0800 I CONTROL [Initandlisten]
> DB
Test
> Show DBS
Admin 0.000GB
Config 0.000GB
Local 0.000GB
Create a database
> Use Vodb
Switched to DB Vodb
> DB
Vodb
The database in MongoDB must be inserted at least one document to display it
> DB
Vodb
> Db.chkrecord.insert ({
... _id:100,
... chktime: ' 2018-07-19 0:10:15 ',
... Chk_key: ' 75 ',
... chkname: ' System TBS used pct ',
... ipaddress: ' 192.168.2.116 ',
... dbname: ' Test ',
... })
Writeresult ({"ninserted": 1})
> Show DBS
Admin 0.000GB
Config 0.000GB
Local 0.000GB
Vodb 0.000GB
> Db.chkrecord.find (). Pretty ()
{
"_id": 100,
"Chktime": "2018-07-19 0:10:15",
"Chk_key": "75",
"Chkname": "System TBS used pct",
"IPAddress": "192.168.2.116",
"dbname": "Test"
}
Use the Connect tool just now to connect with MongoDB Compass community, no need to modify the information, press the default connection
Install mongo4.0 on Windows Server 2012