CRUD operations

Before we integrate our API with MongoDB, it is important to learn how to interact with MongoDB directly. So, let's learn how to perform the basic CRUD operations using the MongoDB command-line tool. To do this, we will need to access the MongoDB container Terminal, but it is extremely easy using Kitematic. In the container's toolbar, click on the exec options. This will launch a Terminal window connected to the MongoDB container Terminal.

When it is launched, type mongo to get into the MongoDB CLI. Take a look at the following screenshot:

For users who are using Linux. You can get into the container by running the following command:

$ docker exec -it mongo sh

Cool! Now we are ready to play with MongoDB.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset