windows安装MongoDB
1.下载地址
https://www.mongodb.com/try/download/community

2.安装
运行安装程序:双击下载的安装程序(.msi文件),然后按照安装向导的指示进行安装。可以按照默认设置进行安装,或者根据需要更改安装路径和其他选项。
或者直接下载zip的不用安装,同时也需要配置环境变量。
3.配置目录
3.1环境变量配置
在Path中加bin目录:E:\work_soft\MongoDB\Server\6.0\bin
3.2运行mongdb
在E:\work_soft\MongoDB\Server\6.0运行cmd,执行mongod

4.创建配置文件
在mongodb的安装目录下,新建mongod.config的文件
systemLog:
destination: file
path: E:\work_soft\MongoDB\Server\6.0\log\mongod.log
storage:
dbPath: E:\work_soft\MongoDB\Server\6.0\db
5.安装mongodb
打开cmd
cd E:\work_soft\MongoDB\Server\6.0\bin;
mongod.exe --config "E:\work_soft\MongoDB\Server\6.0\mongod.config" --install

6.启动/关闭服务
#启动服务
net start MongoDB
#关闭服务
net stop MongoDB