Steps to connect MongoDB Atlas using Shell

We need to follow the following steps to create a connection with MongoDB Atlas using Shell

  • Install MongoDB on your Local Computer.
  • Creating a Cluster in MongoDB Atlas.
  • Establish the Connection to MongoDB Atlas Using Shell.
  • Perform Queries in MongoDB Atlas Using Shell.

Install MongoDB on your local computer

After installing MongoDB. Now open any terminal and write the following command and check whether it is installed properly in your system or not.

mongod


Starting MongoDB server on port: 27017

It starts the MongoDB server on the port 27017. Now, keep this MongoDB Mongo window and open a new tab to run the Mongo shell that will connect to the MongoDB. Write the following command.

mongo


Connecting the Mongo Shell to the local MongoDB Server

Now, our Mongo shell is connected to the local MongoDB Server. Our goal is to connect our Mongo shell to MongoDB Atlas. Let’s create a cluster in MongoDB Atlas and then connect it.

How to Connect to MongoDB Atlas Using Shell?

MongoDB is a NoSQL database. It helps to manage large amounts of complex and unstructured data. It is a document-oriented database which means it stores the data in a document manner, unlike tabular format. MongoDB is a highly scalable and widely used NoSQL database.

Similar Reads

MongoDB Atlas

MongoDB Atlas is a fully managed multi-cloud database. It handles all the complexity of deploying and managing on the cloud service providers like AWS, Google Cloud Platform, and Microsoft Azure. Atlas is a good way to deploy, run, and scale MongoDB in the cloud. MongoDB Atlas also has a free tier, so we don’t need to pay anything to use the free plan....

MongoDB Shell

MongoDB Mongo shell is a JavaScript interface. It allows us to easily interact with MongoDB instances through the command line. It can be used to manipulate data stored in a database. We also can perform the queries in MongoDB from the shell....

Steps to connect MongoDB Atlas using Shell

We need to follow the following steps to create a connection with MongoDB Atlas using Shell...

Creating a Cluster in MongoDB Atlas

Step 1: Go to the MongoDB Atlas website and sign up for an account, You can also directly sign up with Google....

Establishing a Connection to the created Cluster from Shell

Step 1: Click on “Connect” and then select “Connect with the MongoDB Shell“. Then go to ” I have the MongoDB Shell installed ” option. Select the Mongosh version from there....

Writing Queries in Mongo Shell

show dbs...

Conclusion

MongoDB Atlas is simplifies the tasks of deploying and scaling MongoDB in the cloud and it helps us to create the cluster of MongoDB. On the other hand, MongoDB Shell is helping us to explore data stored in MongoDB directly from our terminal. With shell, we can easily modify,and delete data from our Atlas Cluster. So, with these two applications, we can use MongoDB very efficiently in a beginner-friendly way....