Fix MongoDB errno:61 Connection refused on OSX

I have just installed MongoDB thru homebrew, but I got this error when trying to open mongodb shell after the installation. Below is the error stracktrace.

MongoDB shell version: 3.2.6
connecting to: test
2016-05-29T22:57:35.930+0700 W NETWORK  [thread1] Failed to connect to, reason: errno:61 Connection refused
2016-05-29T22:57:35.931+0700 E QUERY    [thread1] Error: couldn't connect to server, connection attempt failed :

exception: connect failed

This error caused by the mongodb service not yet started. I fixed this by starting the service following this command.

$ brew services start mongodb