How to quote a long path when I try to load a db

Hi, My laptop cannot set environment due to permission issue. So when I load the moviedetail dataset, I have to do this: C:\Users\jsun\Downloads\loadMovieDetailsDataset as path.
I tried load(“C:\Users\jsun\Downloads\loadMovieDetailsDataset\loadMovieDetailsDataset.js”) or with {} none of them work.

Please help.

Thanks

cd to that path and try to run load

open cmd line then

  • cd C:\Users\jsun\Downloads\loadMovieDetailsDataset
  • mongo
  • load(‘loadMovieDetailsDataset.js’)

Thanks. However my laptop has restricted permission, I could not set up system environment to have a path for mongo bin.

Hi Judy,
With security restrictions you could still may be try set path per session. So if you open command prompt as a first step you could try this:
SET PATH=%PATH%;c:<path of mongo>
Once you do this you should be able to call mongo from any path in prompt in the current open cmd window.
Please do let me know if that helps sort out the issue.
Regards,
Udai

Thanks. Let me try and I will update the results here.

Thanks

Still not working. please see below:

c:\Program Files\MongoDB\Server\4.0\bin>set PATH=%PATH%:c:\Program Files\MongoDB\Server\4.0\bin

C:\Users\jsun\Downloads\loadMovieDetailsDataset>mongo “mongodb+srv://cluster0-dmn1b.mongodb.net/test” --username m001-student --password m001-mongodb-basics
‘mongo’ is not recognized as an internal or external command,
operable program or batch file.

Hi @Judy_60136,

You will need to go the System Properties in the Control Panel and edit the path in Environment variable.

Please follow the lecture: Lecture: Installing the mongo Shell (Windows) to edit the path.

Then you will be able to load loadMovieDetailsDataset.js and connect to the Atlas Sandbox cluster.

Please let me know, if you have any questions.

Thanks,
Sonali

Thanks. My laptop wont allow me. What is the alternative we have?

Thanks

Hi @Judy_60136,

Please refer to the following link:

If you are still not able to set the path then you can try running mongo by specifying absolute path for MongoDB as follows:

c:\Program Files\MongoDB\Server\4.0\bin\mongo <COMMAND>

I hope it helps!!

Please let me know, if you have any questions.

Thanks,
Sonali