Can't go to loadMovieDetailsDataset

Am using windows so i opened my cmd but when i tried to “cd loadMovieDetailsDataset” it says “The system cannot find the path specified.”
I already created a folder M001 with the zip file in it + i unzip it.
when i type ls it shows me this message ‘ls’ is not recognized as an internal or external command,
operable program or batch file.:"

1

Hi Qornitah_09184,

loadMovieDetailsDataset is a javascript file, cd is used to change directory.

In windows, to list all the files in current directory use:

C:\Users\user\M001> dir

It will list the file. And from this directory (C:\Users\user\M001), run mongo shell and then from mongo shell,

> load("loadMovieDetailsDataset.js")

Kanika

1 Like

@Kanika
How do i load(“loadMovieDetailsDataset.js”) from mongo shell.
What do you mean by mongo shell is it the same as mongo db?

Please learn chapter 1 slowly and carefully, you can found your answer.

1 Like

MongoShell is a command line interface for MongoDB Server.

One of those commands you can run in MongoSHell is the “load” command

https://docs.mongodb.com/manual/reference/method/load/

The loadMovieDetailsDataset.js is a javascript file containing MongoDBShell commands that will execute when you run it from within a MongoDB Shell session.

load("loadMovieDetailsDataset.js")

You could hypothetically run all of the same commands in the script file manually, but “load” saves you the trouble of doing that by running them for you.

HTH,
Mike

1 Like

while giving command Capture ‘load’ is not recognized as an internal or external command,
operable program or batch file.

how to upload js after this error

@HEMANT_70720 The load command in question needs to be executed from within the MongoShell, it looks like you’re trying to execute it from the Windows CMD shell.

HTH,
Mike

yes,
then how to load js file on window

@HEMANT_70720 You can’t use the command directly from windows shell, its a MongoShell command. If you refer to my earlier explanation, here:

you will need to launch the mongo shell then execute the command. The easiest thing to do is launch it from within the directory where the script file is. Then load the JS file.

HTH,
Mike

1 Like