Download the .msi installer: mongodb.com: Community Edition
Start the wizard by double-clicking the .msi file
In wizard:
a. Change location to F:\Program Files\MongoDB\Server\5.0\bin
b. Uncheck the Install MongoDB as a Service
c. Uncheck the Install MongoDB Compass
d. Click InstallAdd C:\Program Files\MongoDB\Server\5.0\bin to your PATH environment variable
Install mongosh
- Download and run the MongoDB Shell .msi installer: mongodb.com: Shell
- Accept location: F:\Users\parsh\AppData\Local\Programs\mongosh
- Add the mongosh binary (F:\Users\parsh\AppData\Local\Programs\mongosh) to your PATH environment variable
Run MongoDB
Run cmd as admin and create the data directory:
cmdc:
md "\data\db"Start MongoDB database:
cmd"F:\Program Files\MongoDB\Server\5.0\bin\mongod.exe" --dbpath="c:\data\db"
# or simply
mongod --dbpath="c:\data\db"Connect to MongoDB:
cmdmongosh
After running this command, you should see information about your MongoDB shell, the local server connection, and some additional information printed to the terminal.