|
Installation and Configuration
Installing MongoDB on Windows -- Part 2
Starting: as a Windows service
.
- Open a command prompt
- Install the MongoDB service:
c:\path\to\mongodb\bin\mongod.exe --config c:\path\to\mongodb\mongod.cfg --install - Start the service: net start MongoDB
Stopping / Removing Windows service
.
- Open a command prompt
- Stop the service: net stop MongoDB
- Remove the MongoDB service:
c:\path\to\mongodb\bin\mongod.exe --remove
Connect to MongoDB
.
- Open another command prompt
- Type: c:\path\to\mongodb\bin\mongod.exe
- Use the default database: use mydb
- Save a test document: db.test.save({a:1})
- Find the test document: db.test.find()
|
|