In my first post on this blog, I set a goal of filling the holes in my tech education. Goals 4 and 5 were to play around mapreduce/hadoop for large scale data processing and gain MySQL knowledge. I decided to squish them both into one and try out mongodb, which is deployed at companies like shutterfly, foursquare, intuit, and others.
So lets start from scratch. Download the correct distribution here and untar it (your version number may be different):
Now make a directory for the data, open a new terminal window in the same working directory, and start mongodb:
If you see: Error: couldn’t connect to server 127.0.0.1 shell/mongo.js:79 its because you did ./mongodb-osx-x86_64-1.8.0/bin/mongo, which connects to an existing database, rather than ./mongodb-osx-x86_64-1.8.0/bin/mongod, which initializes one.
In your other open terminal do:
then you are good to start creating entries and querying.
Thats it. Also, here is a handy MySQL to mongodb conversion chart. I’m going to work on a fun and quasi-advanced stat function, but I’ll write that up in a separate post.