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
You are at mongo prompt
Please exit and run the command from os prompt (#,$,C:\ etc) as per your os
although i did the instructions and changed the system variables by coping the bin path
Hi @asmaa_ali and welcome to the MongoDB community forums.
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.
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
You are trying to run the mongosh mongodb+srv://sandbox.b4nsufi.mongodb.net/myFristDatabase --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
.
thank you so much,it worked
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.