SyntaxError: Missing semicolon. (1:12)

Hi All,

I am New to Mongo and Started Learning from Mango Basics.

i am following the course and when I tried to write the Mongodump it is giving "SyntaxError: Missing semicolon. (1:12)"

Can anybody guide me on Solving this.

Regards
Naveen Kumar

1 Like

:wave: Hi @Naveen_Kumar_C,

Welcome to the MongoDB Community Forums :sparkles:

I think you are missing = after --uri. The syntax will be something like this:

mongodump --uri="mongodb://mongodb0.example.com:27017"

Hope it helps!

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

Thanks,
Kushagra Kesav,
Curriculum Services Engineer

1 Like

Hi @Kushagra_Kesav
Thanks for the response,

But the issue Persists, Getting the same error

Hi @Naveen_Kumar_C,

Kindly run mongodump from the system command line, not the mongo shell. It will work as expected.

Thanks,
Kushagra

the erro stil persist in system command line…
MongoDB Enterprise atlas-11u4vd-shard-0:PRIMARY> mongodump --uri=“mongodb+srv://kevo:singoei2001@cluster0.czop4.mongodb.net/admin”
2021-09-24T09:42:42.800+0000 E QUERY [js] SyntaxError: missing ; before statement @(shell):1:12

MongoDB Enterprise atlas-11u4vd-shard-0:PRIMARY> mongodump --uri “mongodb+srv://m001-student:m001-mongodb-basics@cluster0.czop4.mongodb.net/sample_supplies”
2021-09-24T09:56:36.821+0000 E QUERY [js] SyntaxError: missing ; before statement @(shell):1:12
=== the error still persist now for every example i input

Hi @Evolution_Afri, you are running the command from the shell.
You have to run the mongodump command from your terminal directly and NOT from the shell.
To leave the mongo shell type “exit” and press enter/return (or Control + C as a keyboard shortcut), only then can you enter your commands in the terminal/os shell.

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

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

3 Likes

Do i need to install anything in my terminal? because it responding
zsh: command not found: mongo

zsh: command not found: mongodump

Do you have mongodump binary on your system?

You have to install mongodb tools

in the tutorial. there is no clear explanation of download… its time wasting to try to figure out what needs to be downloaded to follow the tutorial. kindly provide me the exact download for me to perform the exercise in the M001 class.

Check this thread.You have link to database tools in it

Mongoimport command not found for MongoDB 4.4.0 server installation on macOS

1 Like

This really helped me… i can now use the four commands. mongodump, mongoexport, mongoimport, mongorestore…-- the compass really assist to visualise what is happening in the background on localhost. thanks for quick response

Hi @Evolution_Afri,

You can download the MongoDB Database Tools from here.

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

Thanks,
Kushagra Kesav,
Curriculum Services Engineer

How to resolve this issue on Windows? Do we have to download mongodb database tools?

Hey @akshaya_chanchal,

You can download the MongoDB Database Tools for Windows from here.

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

Thanks,
Kushagra

Hi @Kushagra_Kesav
I came across the same error and updated the Environment variable as below with MongoDB tools directory.
image

But now I’m seeing new error as below. Kindly help me rectify this.!

C:\Users\NewUser>>mongodump --uri “mongodb+srv://m001-student:m001-mongodb-basics@my.cluster.mongodb.net/sample_supplies”
‘–uri’ is not recognized as an internal or external command,
operable program or batch file.

Does your prompt really contains 2 > signs?

I suspect not and that you cut-n-paste it with the rest of the command.

1 Like

@Feru_Edwards, is your issue resolve? If it is, please mark my post as the solution so that others know that it works. This will help keep this post useful and efficient. It is simply courtesy.