Lab1.1 Missing semicolon error on mongoimport

After connecting to the cluster in mongodb shell, and running the following command
mongoimport --drop -c restaurants --uri mongodb+srv:// restaurants.json

It gives me this error: SyntaxError: Missing semicolon. (1:14)

Hi @Abanoub_Magdy, and welcome to the MongoDB Community forums! :wave:

You don’t run mongoimport from inside mongo / mongosh. mongoimport is a command line tool that should be run from your operating system prompt.

Thank you for your response

My prompt tells me that it can’t recognize mongoimport as a command. I am on windows

That means that mongoimport is not located in a directory in your path. You can either add the directory to your path variable, or you can switch to the directory where mongoimport has been downloaded to and run it from there. In case you haven’t downloaded the tool, you can download it as part of the MongoDB Tools.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.