I’m an aspiring programmer studying MongoDB as my first database experience. I’m following the “Coding with Mosh” Node.js full course, which includes MongoDB as the database (it’s a paid course so I won’t bother linking the tutorial).
MongoDB version 6.0.0
There are a couple threads on this topic from 2020 and 2021 but they were different OS, different problems and different solutions that didn’t help me.
I have been instructed to import a JSON file to my server, which I’m running locally, using the following command:
mongoimport --db mongo-exercises --collection courses --drop --file exercise-data.json --jsonArray
I make sure that I’m in the directory containing the “exercise-data.json” when I run the command.
Stack overflow answers to this exact problem noted that newer versions of MongoDB don’t include the dev tools necessary for this feature, and that they must be downloaded from
So I downloaded them via the MSI option to the default file path, and then as instructed I added that filepath in environment variables. I have filepaths in place for both mongodb and the dev tools:
Once I had added the paths and it still didn’t work I restarted my system and it still doesn’t work. It still says: mongoimport: command not found.
I would be grateful for any guidance.