Connecting atlas with mongoShell or cmd

i get this error when i try to connect to the cluster in mongoshell.
i downloaded database tools for windows by changing path in system environment as mentioned in mongoDB installation and still having this error

1 Like

You are at mongo prompt
Please exit and run the command from os prompt (#,$,C:\ etc) as per your os


it shows this message

1 Like

although i did the instructions and changed the system variables by coping the bin path

1 Like

Hi @asmaa_ali and welcome to the MongoDB community forums. :wave:

The mongo tool is not distributed with MongoDB version 6.0. If you recently installed/upgraded to MongoDB 6.0 this is why you get the message.

In your original screen shot you had connected to a database using the mongosh tool (this replaces the older mongo tool). However you were then trying to run commands such as mongodump and mongoexport inside of the shell and that won’t work. These commands are meant to be run from your terminal/command prompt. The mongosh is an interactive shell to run queries against the data in your database. mongodump, mongoexport, etc are other tools that allow you copy your data from one server to another.

If you haven’t done so already, you might want to take the M001: MongoDB Basics course.

1 Like

should i download earlier version of mongoDB then try to connect to atlas through cmd right?

You already have mongosh
Please use it to connect to your cluster
mongosh “your connect string”
For utilities like mongoexport,mongodump run the command from your operating system prompt

i have this error in cmd

i still have the same error

1 Like

You are trying to run the mongosh mongodb+srv:// --username m001-student while you are already in a mongosh session. You can’t do that.

After you open your terminal window (it looks like you’re on Windows using a command prompt), you want to type in your mongosh mongodb+srv://.... command from there. mongosh is used to interact with your database server and run queries. You will also run mongoimport or mongoexport from the operating system command prompt, not from inside of mongosh.

1 Like

thank you so much,it worked

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.