With the help of Homebrew, I have installed mongodb-2.6.0 . I have successfully installed the MongoDB server. Then I have tried to connect using the mongo command but I am getting the following errors:
Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed