Connecting MongoDB Atlas to Local System Command Prompt / SyntaxError: unexpected token: string literal


I am just started learning Mongo University M001 Course and I am trying to connect the MongoDB Cloud Atlas DB using my local system instead of integrated IDE environment provided by Course.

I have installed the MongoDB Community Edition. and I have set it up by executing “C:\Program Files\MongoDB\Server\4.4\bin\mongo.exe” in Windows CMD.

Then entered all below commands and none of them working.

mongo “mongodb+srv://” --username m001-student
mongo “mongodb+srv://” (Used by Course)
mongo mongodb+srv://

for the first two commands, im getting (uncaught exception:
@(shell):1:6) error.
and for the last one im getting response as three dots like …

can anyone assist me in connecting to MongoDB Atlas.


Open a terminal and run

mongo "mongodb+srv://" --username m001-student

Right now, you running the command from the mongo shell, instead of the bash shell / terminal.

Useful links

Although you can run mongoDB in many ways, M001 is especially prepared to use the In-browser IDE.

1 Like

Dear Santiago_Miranda

Thanks for your feedback. As, im using Windows computer, I ran the command on related terminal “Windows Command Prompt CMD” as adminastrator and below error is received, is there anyway that i can overcome this.
Do i need to install any other software and then run the command.

same error

I’m not a windows user, but it looks like you should add mongo to the $PATH. Try googling for that, it’s not difficult at all.