Mongoimport not working

I’m CRUD operations episode-14, and I’m trying to import files to my mongodb compass (mongoimport --db mongo-exercises --collection courses – file exercise-data.json --jsonArray).

The first error I got is “mongoimport is not recognized as an internal or external command”.
That’s when I realized that I didn’t have that import module installed in my bin folder. Afterwards I downloaded the zip file for it:

Then I followed this tutorial on how to install it:

Ater installing the modules neccessary, I get another error in the terminal

“2021-01-29T17:21:35.122-0700 error parsing command line options: error parsing positional arguments: provide only one file name and only one MongoDB connection string. Connection strings must begin with mongodb:// or mongodb+srv:// schemes
2021-01-29T17:21:35.128-0700 try ‘mongoimport --help’ for more information”.

Here’s my bin:



1 Like

I solved it; the last error was a syntax error as there was a space between the dashes and file. (-- file) should be (–file).

Also if anyone else is experiencing that import error: “mongoimport is not recognized as an internal or external command”, check the the 2 links I posted above.

Thank you so much you saved me !