MongoDB shell

If you followed Chapter 1, Introduction to MEAN, you should have a working instance of MongoDB in your local environment. To interact with MongoDB, you'll use the MongoDB shell, which you encountered in Chapter 1, Introduction to MEAN. The MongoDB shell is a command-line tool that enables the execution of different operations using a JavaScript syntax query language.

In order to explore the different parts of MongoDB, let's start the MongoDB shell by running the mongo executable, as follows:

$ mongo

If MongoDB has been properly installed, you should see an output similar to what is shown in the following screenshot:

MongoDB shell

Notice how the

Get MEAN Web Development - Second Edition 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.