Keep getting this error "SyntaxError: missing ; before statement @(shell):1:12 MongoDB Enterprise atlas-tv4zgl-shard-0:PRIMARY>"

I am on the exporting and importing video on the mongo basics course and I keep getting this error everytime i try to mongodump some sample supplies. This is what I am pasting in the terminal

mongodump --uri “mongodb+srv://”`

I have tried to put that semi colon at the beginning, front and everywhere but for some reason it is not working and I do not know what is causing it. How can I fix this error please help

Please post a screenshot of what you are doing that shows the issue you are having.

I suspect that you are doing mongodump when inside the mongo shell. You have to do that outside the mongo shell and directly on the command line of your terminal.

Screenshot (80)_LI

This is it

The screenshot confirms

You must exit the mongo shell and run that command directly on the terminal.

I am confused. I thought where I am running the code is the terminal. Which terminal am i supposed to run it in?

In Terminal 1 where you run it right now but after exiting the mongo shell.

how do i exit the mongo shell?

With the command exit, but quit() also works.

I already tried exit and quit but then it throws an error like this

I there some other alternative to this because I see the tutor is not even using the mongo one it seems like a personal one on her machine

You exited twice. So you exited the mongo shell and then you exited the terminal shell. Try to reload the page.

I have reloaded it numerous time and i only type exit once and press enter then when I try pasting code there it then throws the error. But again what alternative can i use?

May be you did not get what steevej was saying
Run the mongodump in the terminal but at os prompt as below
user@M001# mongodump …
Do not connect to mongodb.You have to use exit or quit() only when you are connected to mongodb

1 Like

I do not understand what you are saying. Please explain this to me step by step because I have spent almost the whole day trying to get something this simple to work. I am totally lost now. Please help

As Ramachandra_Tummala and steevej stated you need to run mongodump from the OS shell not the mongo shell. You can tell the difference by the prompt next to where you are typing.

If you see someting similar to


Such as in your first screen shot then you are in the mongo shell and connected to your database and you CAN’T run mongodump from your mongo shell, so typing ‘exit’ once will bring you out of the mongo shell.

If you see:


like in your second screen shot then you are in your linux OS shell. This is where you need to run the mongodump. (Typing ‘exit’ here will close the shell)

user@M001# mongodump --uri ""

Hopefully this helps clear things up.

1 Like

Still not working.
Screenshot (82)_LI
I just dont know what to do anymore. What terminal is the author using? She’s not using this one for some reason I suppose. What else can I use that has straight forward instructions?

This is the correct terminal and the command mongodump was found. You are getting a different error related to DNS.

Although I’m confused…what lab are you trying to complete? The screen shots are for Chapter 1: Connecting to your Atlas Cluster and doesn’t say anything about doing a mongodump? To complete the lab you just need to successfully connect to your MongoDB Atlas cluster with the IDE and the “Run Test”.

1 Like

I completed that connect to Atlas cluster successfully but then since chapter 2 the importing and exporting one has no IDE, i could not follow along with the instructor so I just opened the IDE found in chapter one. Is there something else I’m meant to be using or what? Because if you notice on this thread, I have been asking what other alternative to this I could use but everyone’s been ignoring it so I am hoping you do not ignore it too so what terminal should I be using?.

We are ignoring. It is because the alternative are more complicated. So if we cannot help you with the simplest case it will be even harder with the alternatives.

But just so that you know, you may use any terminal you want as long as, and that’s the hard part, the tools are installed correctly. The IDE helps you play with the tools without installing them. Installing them is more complicated than using them. Once you conquer the usage then you may try the installation.

ok I understand but you could’ve just said so rather than totally ignoring the question but anyways since @tapiocaPENGUIN asked why I am using the IDE on chapter one when I am on chapter two, so then which one should I be using.?

You will want to use the IDE space for this chapter, which should be on the bottom of the list “Your Chapter 2 IDE space” This has files/example for chapter 2 related tasks.

Although I tried a mongodump from my Chapter 2 IDE and it didn’t work. I’m assuming it might be for security reasons but you can try if you want incase I made a typo :sweat_smile:

If you wanted to try a with another terminal (windows cmd or linux terminal) based on your OS you can download the mongo tools from here This allows you to download and install the mongoshell and database tools. Once they are installed on your computer you can connect to your atlas cluster.