目录
https://www.mongodb.com/try/download/community
https://www.mongodb.com/download-center/community/releases/archive

将下载的安装包 mongodb-windows-x86_64-4.4.0.zip 解压到安装路径
这里的解压路径是 D:\Hadoop\MongoDB\mongodb-win32-x86_64-windows-4.4.0
添加MONGODB_HOME变量

将MONGODB_HOME变量添加到环境变量

在MongoDB根目录下新建db、log文件夹

初始化数据存储(命令行执行)
mongod --dbpath "D:\Hadoop\MongoDB\mongodb-win32-x86_64-windows-4.4.0\db"执行之后生成一下文件,然后关闭命令行窗口

在MongoDB根目录下创建配置文件 mongodb.conf
## 端口号(默认27017)
port=27017
## 数据存储路径
dbpath=D:\Hadoop\MongoDB\mongodb-win32-x86_64-windows-4.4.0\db
## 日志存储路径
logpath=D:\Hadoop\MongoDB\mongodb-win32-x86_64-windows-4.4.0\log\mongo.log
## 启用日志文件(默认启用)
journal=true
## 日志是否追加
logappend=true
## 是否过滤无用日志信息(调试模式可改为false)
quiet=true安装MongoDB服务
mongod --config "D:\Hadoop\MongoDB\mongodb-win32-x86_64-windows-4.4.0\mongodb.conf" --install --serviceName "MongoDB"1、命令行启动(以管理员身份)
net start MongoDBnet stop MongoDB
2、手动启动
我的电脑 - 管理 - 服务和应用程序 - 服务 - MongoDB

mongo
db
db.help() help on db methods
db.mycoll.help() help on collection methods
sh.help() sharding helpers
rs.help() replica set helpers
help admin administrative help
help connect connecting to a db help
help keys key shortcuts
help misc misc things to know
help mr mapreduce
show dbs show database names
show collections show collections in current database
show users show users in current database
show profile show most recent system.profile entries with time >= 1ms
show logs show the accessible logger names
show log [name] prints out the last segment of log in memory, 'global' is default
use <db_name> set current database
db.mycoll.find() list objects in collection mycoll
db.mycoll.find( { a : 1 } ) list objects in mycoll where a == 1
it result of the last line evaluated; use to further iterate
DBQuery.shellBatchSize = x set default number of items to display on shell
exit quit the mongo shell