Unable to load movie details dataset

For some reason I am only able to start the mongo shell through the bin folder and cannot start it through the folder where I have the loadMovieDetails.js file. I am sure I am missing something simple but I am unable to load the dataset a this time.

C:\Users\rcourtney\M001> mongo “mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics
‘mongo’ is not recognized as an internal or external command,
operable program or batch file.

It is a PATH issue
You have to update your PATH to include mongodb so that you can invoke mongo commands from any directory

I tried C:\Users\rcourtney\MongoDB\Server\4.2\bin\M001> and it does not work. Mongo shell only starts for me when bin is the last entry in the path

Yes i understood your problem
You have to edit your Windows environment variable PATH and add mongodb
Please check our forum on how to set it
Screenshots available

As a last resort, you may use the full path (or relative path) name of mongo to start it.

when I start it I get this error when trying to load the .js file,

MongoDB Enterprise Cluster0-shard-0:PRIMARY> load(“C:\Users\rcourtney\Desktop\MovieDetails\loadMovieDetailsDataset.js”)
courtneyDesktopMovieDetailsloadMovieDetailsDataset.js] doesn’t exist
courtneyDesktopMovieDetailsloadMovieDetailsDataset.js :ror loading js file: C:Users
@(shell):1:1

Try with slash rather than backslash. Backslash is Windows only. Inside the shell it is normal slash.

1 Like

Thanks @steevej-1495 and @Ramachandra_37567 for your contribution.

Hi @Ryan_Courtney_86121,

I’m glad your issue got resolved. If you have any other issue please feel free to ask your question in the discussion forum.

Thanks,
Shubham Ranjan
Curriculum Support Engineer