Loading Data into your sandbox

Hello everyone,

This is for people who want to load “loadReviewsDataset.js” into the database
1- connect with mongo shell
2- use this command " use video"
3- use the 3 commands in your loadReviewsDataset.js

Hi @ThayerYounus,

Thanks for sharing.

For any other learners who might be having similar issues :arrow_down:

The instructions for loading the datasets are same as that of what has been discussed in the Chapter 2: Loading Data into Your Sandbox Cluster.

Rather than running the individual commands, you can simply use the load() method to run the commands mentioned in the javascript file.

Hope it helps!

Please feel free to get back to us if you have any other query.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

Hi @Shubham_Ranjan

I tried to run load(“loadReviewsDataset.js”) but unfortunately, it didn’t work, that’s why I posted the other solution, well I didn’t know why load method didn’t work for me. it would be highly appreciated if you explained how to run the JS file via load() method

Hi @ThayerYounus,

Sure, can you share what is the error you are getting when you are running the load command? Make sure that the file is located in the same directory from which you are connecting Mongo shell or you are providing the absolute path for the js file.

Kanika

Hi @kanikasingla,

Thanks for your replaying, I was providing an absolute path, but the thing is I was putting Backslash instead of Forwadslash load("\M001\loadReviewsDataset.js") and it should be like this load("/M001/loadReviewsDataset.js"). . my bad;)

Glad you resolved it :slightly_smiling_face: Good luck!