Some time ago to learn some of the knowledge of MongoDB, think of hands-on practice, so with homebrew installed a bit of MongoDB:
$ Brew Update
$ Brew Install MongoDB
The use of the command before the installation of homebrew, midway may have interrupted the situation occurred, try a few more times just fine.
While I was cheerfully ready to practice, the MONGO command prompted "Connect failed".
Tidy up a bit of thought, should be the database service does not open the reason, so execute mongod command. See the error situation: There is no data directory configuration database.
This directory should be installed with no default value, so we have to manually configure the following. In the current user's documents directory, create a new mongo/db directory. Then execute the command:
$ mongod--dbpath ~/documents/mongo/db
The service can already be opened successfully at this time.
After configuring and starting the related service, execute the MONGO command again, OK, you can enter the world of MongoDB.