How it works...

MongoDB runs as a process on your local file system. By default, it stores files in /data/db. This process must be running in order for you to read or write any content from MongoDB. In the coming sections of this book, it's important to make sure you are running the process. One easy way to make sure that MongoDB is always running is to create a process daemon to run in the background. You can create such a daemon using the following command on Mac OS:

mongod --fork --logpath /var/log/mongodb.log

This starts the a MongoDB process, and logs all its events to a log file on your machine.

The mongo command activates a special MongoDB shell that you can use to send commands to your MongoDB process. Following are the most common ...

Get MEAN Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.