Mongo is not recognized when in loadMovieDetailsDataset.js

image

  1. In relation to ’mongo’ is not recognized as … please refer to Chapter 2: The MongoDB Query Language + Atlas / Installing the mongo Shell (Windows).

  2. As for ’load’ is not recognized as … please referer to Chapter 2: The MongoDB Query Language + Atlas / Loading Data into Your Sandbox Cluster. It clearly shows that you must connect to your sandbox cluster first. You were still in Windows shell when running load(…).

I’ve followed all the steps till the 2nd video you are reffering to and everything works till just before 5minutes in the 2nd video, so I don’t get it

Please go back at the 1st video, look at the transcript at 04:46. You get mongo is not recognized as … because your path is not setup correctly. Just in case there is something else please provide a screenshot for the path environment variable.

1 Like

Hi @Amber_74801,

In addition to @steevej-1495,

Please navigate to the bin directory inside the MongoDB server directory and run the mongo --nodb command from there and share the output.

If it works then your path was not set correctly. Please share a screenshot of it as well.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

Hi @Shubham_Ranjan,
I’m also facing the same problem, when i connect to atlas from the path C:\Users\kesireddi.jasitha\M001\loadMovieDetailsDataset, it says ‘mongo’ is not recognized. But i’m able to connect to sandbox from C:\Program Files\MongoDB\Server\4.2\bin

It is path issue

run path at windows cmd prompt and show us the output
mongodb/bin should be in your path if you want to invoke mongo from anywhere

Alternately you can cd to the dir where your .js file is residing
Then invoke mongo command using full path
i,e C:\Program Files\MongoDB\Server\4.2\bin\mongo
Once you are connected run load command

Best thing is to fix your path issue

Is this what you asked me to do?

You have to enclose it in quotes

ex:
C:\Users>“C:\Program Files\MongoDB\Server\4.0\bin\mongo” --version
MongoDB shell version v4.0.5

Hi @Jasitha_Kesireddi,

Please review the instructions mentioned in this lecture Chapter 0: Setup - Installing the mongo Shell (Windows) and try to set the path.

Let us know if you face any issue.

~ Shubham