Steps:
- Download MongoDB this link link.
Review MongoDB folder.
In MongoDB, it contains only executable files 10 Plus(exe) in the bin folder.path:- Files under $MongoDB/bin folderConfiguration File
Create a MongoDB config file, it’s just a text file, for exampleC:\mongodb\mongo.config:#store data here dbpath=C:\mongodb\data \\all output go here logpath=C:\mongodb\log\mongo.log \\log read and write operations diaglog=3Run MongoDB server
Usemongod.exe --config C:\mongodb\mongo.configto start MongoDB server.C:\mongodb\bin>mongod --config C:\mongodb\mongo.configAll output going to:
C:\mongodb\log\mongo.logConnect to MongoDB
Uses mongo.exe to connect to the started MongoDB server.C:\mongodb\bin>mongo MongoDB shell version: 2.2.3 connecting to: test
//mongodb shell
MongoDB as Windows Service
Add MongoDB as Windows Service, so that MongoDB will start automatically following each system restart. Install as Windows Service with--install.C:\mongodb\bin> mongod --config C:\mongodb\mongo.config --installA Windows service named “MongoDB” is created.
To start MongoDB Service:
net start MongoDBTo stop MongoDB Service
net stop MongoDBTo remove MongoDB Service
C:\mongodb\bin>mongod --remove