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

Hi,

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://sandbox.y8aoy.mongodb.net/admin” --username m001-student
mongo “mongodb+srv://m001-student:m001-mongodb-basics@sandbox.y8aoy.mongodb.net/admin” (Used by Course)
mongo mongodb+srv://m001-student:m001-mongodb-basics@sandbox.y8aoy.mongodb.net/admin

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.

1 Like

You should use MongoDB University course specific forum for the course related question.

You are running the mongo command while you are already in the mongo shell. You have to exit the mongo shell and run your command in the bash prompt of the IDE.