I am following the tutorials at docs.mongodb.org, I have completed the first tutorial which was to install mongodb on a windows machine. I am now at the second stage which is ge
1.To begin using MongoDB, Open CMD with admin privilege and type : "C:\Program Files\MongoDB\Server\4.2\bin\mongo.exe"
2.To create data directory(open another cmd terminal)
cd C:
md "\data\db"
3. To start your mongo DB database, type in cmd the following lines:
"C:\Program Files\MongoDB\Server\4.2\bin\mongod.exe" --dbpath="c:\data\db"
(The --dbpath option points to your database directory.)
[you can also do step 2 and 3 first and then step 1]
ref:https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/