Mongosh: command not found

im struggling to ascertain my problem here , i have the 0.0.0.0 user added in the network access, pasting in the connection string to paste in is:
mongosh “mongodb+srv://sandbox.o4xlz.mongodb.net/myFirstDatabase” --username m001-student

(i had to delete my own user to have it default to the sudent one here,
but when i press enter in the terminal , i get this:
bash: mongosh: command not found
any pointers?

Are you trying the command in IDE or on your local host?

Did you try with mongo instead of mongosh?

thanks for responding, im using the terminal , pasting in the connection string as the instructions state:
mongosh “mongodb+srv://sandbox.o4xlz.mongodb.net/myFirstDatabase” --username m001-student

mongosh:
Please enter a MongoDB connection string (Default: mongodb://localhost/): mongosh “mongodb+srv://sandbox.o4xlz.mongodb.net/myFirstDatabase” --username m001-student
MongoshInvalidInputError: [COMMON-10001] Invalid URI: mongosh “mongodb+srv://sandbox.o4xlz.mongodb.net/myFirstDatabase” --username m001-student
Press any key to exit:


i received the message to update my mongo to mongosh,
put the password in for user , looks to be ok :slight_smile: just terminal isnt playing ball now… ?
user :m001-student
pass:m001-mongodb-basics

HI @liam_fawcett, I am glad that it is working now.

In case you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

1 Like

Hi @Ramachandra_Tummala @SourabhBagrecha ,
after doing this i want to run command mongodump to export data but not able to do that in my system localhost .
and i read that answer to run mongodump command in osprompt level .
since i am using windows ,i dont Know how to do that .
plz help me out
command :
(mongodump --uri “mongodb+srv://m001-student:m001-mongodb-basics@sandbox.tgc19.mongodb.net/sample_supplies”)

You are running the command at mongo prompt
Exit from mongo shell and run the command from os prompt like below
C:\Users\xyz>mongodump --uri …

1 Like

thanks for you support @Ramachandra_Tummala .

1 Like