Command Operations in MongoDB

CRUD operations from the shell

Once the MongoDB server is up and running, one can connect to it using Mongo shell client. On the terminal, on our platform, the server automatically connects, so that you don’t have to set it up.

All the functionalities that are provided in the shell client are provided through MongoDB drivers too. Drivers are provided for all popular programming languages, which means that all features that are shown in this chapter can (and should) be done through the code. However, for demonstrative purposes, the shell client is used.

Note: To get a good understanding of all the commands, and for good practice, make sure to try out all of the commands in this lesson in the terminal provided at the end of this lesson.

It’s important to note that MongoDB commands are case-sensitive.

Using mongo

To start the shell client, type the following command in the terminal :

mongo

Get hands-on with 1400+ tech skills courses.