Working with the MongoDB shell

Whenever we start using MongoDB, the first thing we need to explore is the available commands that we can use in order to interact with it. Looking up the available databases, collections, documents, and so on can be done with a simple client tool called MongoDB shell. It is similar to the MySQL client. This shell program is included in the standard MongoDB server installation. We can launch it using the following command:

mongo

Refer to the following screenshot:

If you see that a session ID has been created, as shown in the preceding screenshot, everything worked fine. If you get an error, the server is probably ...

Get Hands-On RESTful Web Services with Go - 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.