First things first...

Well, hope that you have a working MongoDB on your system. Now, let's see how it looks like !!!

I am using a Windows 7 for this tutorial. If you are using other operating systems, apart from the OS Specific instructions, others should work fine.

We know that, MoongoDB comes with a database server and a client preloaded with the distribution.

Now, we are going to add this in the system path.
  1. Right click on the My Computer icon, Click on Properties.
    Set environment path
  2. Another window will pop up to set up system settings, On the left pane, click on Advanced system settings
    Set environment path
  3. Clicking on this link, will open another window, click on Environment Variables...
    Set environment path
  4. On the pop up, you see different system variables available, find for variable named Path and click on Edit...
    Set environment path
  5. On the Edit System Variable pop up, add MongoDB Server bin path which in my case is, C:\Program Files\MongoDB\Server\3.0\bin
    Set environment path
  6. Now, click OK 3 times and cross out the Control Panel window. And again, click on Start Menu, type cmd on the search box and hit Enter
    Open cmd
  7. This will open up the console, now type cd ../.. and hit Enter
  8. Type mkdir data and hit Enter
  9. Type cd data and hit Enter
  10. Type mkdir db and hit Enter
  11. Type mongod and hit Enter
  12. This will start the MongoDB server installed on your system on port 27017 and the data will be stored in /data/db path.
    Start MongoDB Server
  13. Open another console as mentioned in Step 6
  14. Type mongo and hit Enter
  15. This will invoke mongo shell, which will connect to the server running in localhost, port 27017 and test database by default
    Mongo shell
Congratulations, you just have completed the very basics of MongoDB. Next will be looking into mongo shell.


Prev     Next
Palash Kanti Kundu

2 comments:

  1. Replies
    1. Eta ekta natun technology related to Data persistence and development.
      Ei bar tui e bol, natun technology niye ki hoy !

      Delete