Install MongoDB on Mac.

It really took me two days to figure this out but I think it should be simpler. Here are the step by step instructions to install Mongo on Mac. I will add the instructions for Windows installation shortly.

    1. Download MongoDB from here.
    2. On Mac, it will download into the Downloads folder. Move it to your desired location and unzip it.
    3. Set the path to the PATH variable in terminal using this commandScreen Shot 2015-12-14 at 9.44.04 PM
    4. Make sure this PATH is set correctly by typing echo $PATH in the terminal.
    5. Once this is set, close the Terminal and reopen it.
    6. At the prompt type mkdir -p /data/db
    7. Go to the mongo install folder, traverse into bin folder and type ./mongod at the prompt.
    8. Usually this will start the database. But sometimes, this will happen. Screen Shot 2015-12-14 at 10.02.24 PM
    9. What the above message is trying to say is that it is unable to start the database on port 27017, which is the default port for MongoDB.
    10. To verify if another instance of MongoDB is running, type the following command at the terminal Screen Shot 2015-12-14 at 10.07.00 PM
    11. You should see something likeScreen Shot 2015-12-14 at 10.09.12 PM
    12. As shown above, the mongodb is running and its PID is 10802.
    13. So at terminal prompt, type kill -9 10802
    14. Repeat the step 7 and that should bring up the MongoDB.
    15. Also I am in love with this amazing tool RoboMongo and you can get this from here.
    16. I will post using the RoboMongo in the coming posts. Happy mongoing.:)