Getting Uncaught: SyntaxError: Missing semicolon when trying connect with database deployment via mongosh

Thanks for the hint, my mongod was running using brew.
But I am still not able to connect to my course collection using the shell, could you please help me understand this ?

Hi @Madhusoodhan_M, welcome to the community.
You are inside the shell already, executing the connection command from the shell would return an error similar to yours.
Since you are already connected to your locally running mongod process you’d need to exit out of it and re-connect with the cluster by following the below-mentioned process:

Step 1: Exit from mongosh

You can do so by pressing Ctrl/Command & C together.
Alternatively, you can type exit and press enter to achieve the same.

Step 2: Connect to the course-provided read-only cluster

Now, you just need to execute the connection command but this time please connect with the read-only cluster using the connection string provided to you at the beginning of the course. You can also find the same in the answer to the first question of this FAQ post:

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

Thanks and Regards.
Sourabh Bagrecha,
MongoDB

1 Like

Thanks a lot @SourabhBagrecha , exiting from the mongod process and executing the command from the directory where the project is downloaded, solved my problem.

2 Likes