Friday, 20 February 2015

What is MongoDB and How to install MongoDB and its Service

MongoDB


MongoDB is an open-source, document-oriented database designed for ease of development and scaling.

Below given table shows the relationship of RDBMS terminology with MongoDB
RDBMS
MongoDB
Database
Database
Table
Collection
Tuple/Row
Document
column
Field
Table Join
Embedded Documents
Primary Key
Primary Key (Default key _id provided by mongodb itself)

Install MongoDB On Windows

To install the MongoDB on windows, first doownload the latest release of MongoDB from http://www.mongodb.org/downloads  Make sure you get correct version of MongoDB depending upon your windows version.

Install MongoDB Service

After installation we need to run MongoDb service.

1. Open command prompt in administrator mode.
2. Go to path C:\Program Files\MongoDB 2.6 Standard\bin

3. Make 2 directories in C drive. Run the below commands.
  mkdir c:\data\db
  mkdir c:\data\log



4. Run the below command
  
   echo dbpath=c:\data\db>> "C:\Program Files\MongoDB 2.6 Standard\mongod.cfg" 






5. To run the service run below command. In this service name is "MongoDB 2.6 Standard"

   sc.exe create MongoDB binPath= 
"\"C:\Program Files\MongoDB 2.6 Standard\bin\mongod.exe\"    
--service --config=\"C:\Program Files\MongoDB 2.6 Standard\mongod.cfg\"" 
   DisplayName= "MongoDB 2.6 Standard" start= "auto"


you will get the message service created successfully.


6. After installation go to service.msc and you will see Mongo Db service in the list.










7. To start the service write below command.
  
  net start MongoDB



you will get above message service was started successfully.

8. To check the service is running go to run and write service.msc and see service is running as highlighted in below screenshot.




Enjoy Mongo Db and create your collection(table).

Thanks for reading this article.


No comments:

Post a Comment

Implement Authorization in Swagger with Static Value in Header .Net 8

If you want an anonymous user should not run the APIs. To run your API Endpoints From Swagger / Postman / Code the user should pass the head...