Stuck with connecting

Hi,

I have installed mongosh in directory:

C:\Program Files\mongosh

Due to security settings on my laptop I cannot add the path to environmental variables; to run mongosh I am going into that directory and run .exe manually

once mongosh cmd window is opened:
it says:
Please enter a MongoDB connection string (Default: mongodb://localhost/):
then once I try to run command it comes up with message

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

I am lost; no experience with running shell and not sure how to over come this; I would like to be able to carry on with the course

Thanks,
Agi

@Agnieszka_Zaborowska it looks like you are entering: mongo “mongodb+srv://sandbox.j6dz0jc.mongodb.net/Sandbox” --username m001-student.

The connection string portion of that is only mongodb+srv://sandbox.j6dz0jc.mongodb.net/Sandbox.

To include the username in the connection string you can do: mongodb+srv://m001student@sandbox.j6dz0jc.mongodb.net/Sandbox.

3 Likes