Missing semi colon before statement in shell

i am getting this error while connecting to cluster , missing semi colon before 1:7102

@rehan_59764,
It looks right …
Try closing out all background programs & restarting Windows. Then start fresh from the mongo shell.

@rehan_59764, please read this thread.

It lists a number of very common questions new students ask, including yours.

I would also suggest editing your screenshots so they only include the relevant information. You are currently showing a LOT of information about your workstation, which makes you more vulnerable online.

It does not. Rehan is trying to start the Mongo shell, from inside the Mongo shell.

1 Like

Looking at it closer … if I was not so tired from a long cold night at work AND the command line window was a little bigger … i would have caught it earlier …

Thanks for Clarification.

Heh, no worries :slight_smile:

Long, cold nights at work suck. Especially if they’re not spent with fun colleagues :expressionless:

Hang in there, get some sleep :slight_smile: I’ll be out of the running for three days, tied up at a course.

1 Like

Hi,
for some reason when I type the following command, it gives me this error. How do i resolve this issue?

@Tawbin_17250 ,

Refer to:

https://discourse.university.mongodb.com/t/all-new-users-please-read-these-are-not-blocking-errors/4625

It is not working because you are already inside the Mongo shell.

Exit the shell, then run the command from the Windows Command Line.

:vulcan_salute:

Wayne Cassity

2 Likes

after i write quit()
then typing the command to connect to ATLAS , it gives me connection failed error.
i am using mongodb 3.4.18

Hi rehan_59764,

When you run mongo --nodb, you are already in the Mongo Shell. If you want to connect to any other mongo cluster like you are trying to do by running this:

> mongo "mongodb://cluster0-shard-00-00-ddsf0.mongodb.net:27017"

You need to run it from outside the mongo shell, the same way you must have done it when you ran “mongo --nodb”.

> quit()
// Press [Enter/Return]
C:\Windows\system32> 

Then you need to write the correct connection string. Steps to do that:

  • Login to Atlas
  • click on Connect button
  • Choose a connection method
  • Connect with the Mongo Shell
  • Choose MongoDB version
  • Copy the string
  • Paste it on your command line

Let me know in case of any confusion and on an unrelatable note, it’s always advisable to use the latest version of MongoDB.

Kanika

2 Likes

What would be very helpful, is you would show us both the error message and the full command you’re entering. So either copy and paste it here as text, or provide a screenshot like before. Otherwise, we’re sailing blind and cannot help you.

Most importantly, try to understand what you’re actually telling your computer to do with the command(s). Don’t just copy them from the class notes, but understand what each command, flag and parameter means. Otherwise, you will simply keep repeating things “because we did them like that before”, instead of actually learning about MongoDB.

thanks so much , yes i got what i am doing wrong thanks for help